I have two t-sql queries using SqlServer 2005. How can I measure how long it takes for each one to run?
Using my stopwatch doesn’t cut it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One simplistic approach to measuring the “elapsed time” between events is to just grab the current date and time.
In SQL Server Management Studio
To calculate elapsed times, you could grab those date values into variables, and use the DATEDIFF function:
That’s just one approach. You can also get elapsed times for queries using SQL Profiler.