Code Snippet |
declare @qry varchar(100), @StartLoc int DECLARE @StartTime datetime, @EndTime datetime SET @StartTime = CURRENT_TIMESTAMP; -- **********QUERY TO BE CHECKED ************* SELECT * FROM [Venkat] -- ***************************************** SET @EndTime = CURRENT_TIMESTAMP SELECT DATEDIFF(ms, @StartTime, @EndTime) GO |
Venkatesan Prabu MCITP,MCAD,MCTS,CCNA. Worked as a ProjectLead(Senior .Net developer,SQL DBA). Now, Managing Director of KAASHIV INFO TECH, Chennai This Blog aims in serving the community in a better way. This blog is read by developers in 159 countries with average of 400 hits per day. Please post your valuable suggestions and hold my hand to serve the community. Lets make a new world with good thoughts and good minds....... This blog serves the SQL server community all over the world.
8.3.08
To retrieve the query execution time
CURRENT_TIMESTAMP is used to retrieve the current time. By using this system function we can compare the time before and after the query execution.
No comments:
Post a Comment