Quantcast
Channel: Working With Data – Sql And Me
Browsing all 24 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

SQL Server – SELECTing/Displaying Top N rows from a table

To SELECT only top N rows from a table we can use TOP clause in SELECT statement. Using TOP clause we can also specify percentage option. For example, both of these statements are valid: USE SqlAndMe...

View Article


Image may be NSFW.
Clik here to view.

SQL Server – Import text file using xp_cmdshell

There are several options available to import data from external sources to SQL Server. Such as Import & Export Wizard, BULK INSERT command, SSIS and OPENROWSET. Apart from this options you can...

View Article


Image may be NSFW.
Clik here to view.

SQL Server – Custom sorting in ORDER BY clause

ORDER BY clause can be used to sort the results returned by SELECT statement in SQL Server. It orders the result set by specified column list. When used with character data type columns it sorts data...

View Article

Image may be NSFW.
Clik here to view.

SQL Server – Calculating elapsed time from DATETIME

Elapsed time can be calculated from DATETIME field by extracting number of hours/minutes and seconds. You can use below query to calculate elapsed time between two dates: -- Vishal -...

View Article
Browsing all 24 articles
Browse latest View live