Archives: July 2013
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 also use xp_cmdshell to import text file to SQL Server. We need to utilize dos command TYPE for… Read more
This is a follow-up post on SQL Server – Check SQL Agent Job History using T-SQL.
SQL Server Agent stores SQL jobs history in sysjobhistory. It has two different columns for date and time, Run_Date and Run_Time. Since this is not available as DATETIME we cannot filter… Read more
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:
SELECT TOP 5 EmployeeId,FirstName,LastName
GO Read more
By default SQL Server ERRORLOG is stored in "C:\Program Files\Microsoft SQL Server\InstanceFolder\MSSQL\Log" folder. The ERRORLOG location is configured as a startup parameter for SQL Server Service.
To change the location of ERRORLOG you need to modify the startup parameter -e.
For example, if you need to move logs to C:\Logs\… Read more
If you have lost the password for sa account or does not have any administrative account and you are locked out of SQL Server you can still login to SQL Server as an Administrator using Local administrator account.
You can use any account which is part of local Administrators… Read more