Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing times at key points during a SQL script

Status
Not open for further replies.

BrooksMT

Programmer
Jun 12, 2013
28
US
I'm running a lengthy SQL script from the Visual Studio using a Execute SQL task.

What statements can be added to the script to display the date/time at key points (similar to a Debug.Print)?

Ideally, I'd like to write to the Progress window but saving to a text file would also work.

Thx,

Brooks
 
If you have admin access to your dev server or sandbox, you can use profiler, and monitor the sp stmt starting events. This will show you how long each statement takes.
 
Thanks for the post. I have admin rights but am not familiar with the profiler. Where is it located?
 
Profiler is a performance tool, and can be found in the programs menu in the SQL Server group.
 
Found it, thanks. I will check it out.

My workaround was to create a little RunLog table and add statements to the script at strategic points:

INSERT INTO RunLog ( StepTime, StepDesc ) SELECT GetDate(), 'step 1 temp1'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top