Friday, March 23, 2012

SQL profiler on tracing store procedure

SQL profiler on tracing store procedure


At this point of life, may be everyone knows how to create a SQL profiler on tracing Store Procedure. However, if you want to get information about specific Store Procedures and less noise on the server then you need to use filter on objected.
Step 1: Get object ID
use abc
SELECT name, create_date, modify_date, object_id
FROM sys.objects
WHERE type = 'P'
AND name in
('kwUploadKeywords', 'kwUploadKeywordMatrix', 'kwUploadKeywordTranslation')

1852585688
1884585802
1868585745
Step 2: Open SQL profiler from SSMS Tools è SQL server profiler è Create a trace file as bellow
 


Step 3 - Event Selection:  By default you won’t see the SP:Complete. You need to click on the Show all Events and select from there. Then you can select all or specific columns like this. 



Step 4 – Edit the filters


Step 5 - Run




Issue: You might experience some issue. It might not run right of way. It takes some time to setup connection. So, be patient. You can do some pause and play. If the store procedures start running it will start tracing at this moment. Otherwise, it will be just sitting there.

No comments:

Post a Comment