Tuesday, September 24, 2013

SQL Query Execution time of you in SQL Management Studio

You can check the Execution time of you SQL Query in SQL Management Studio. like this

It is very simple that you just put your SQL Query in to the Estimated time execution query

 DECLARE @StartTime datetime  
 DECLARE @EndTime datetime  
 SELECT @StartTime=GETDATE()   
  -- Write Your Query  
 --This will return execution time of your query  
 SELECT DATEDIFF(NS,@StartTime,@EndTime) AS [Duration in millisecs]   

SQL Get all Index create script from Database

To get all script from database as a create new index into another database you can use the following --Get all Index Script SELECT...