Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While troubleshooting performance issues on a SQL 2008 instance, I've noticed there are several SPIDs which appear to be executingcreate procedurestatements for already existing procedures.

Is this part of SQL's normal internal functioning, or do I have some odd application logic going on here? I can find these procedures listed in SSMS, and it says they were created years ago.


share|improve this question

migrated from Feb 14 '12 at 20:28

This question came from our site for professional and enthusiast programmers.

up vote 5 down vote accepted

This is not running the create procedure statements. The text you are receiving is the body of the procedure that has been called, not the actual call (I assume you are catching SP:Completed and not SP:StmtCompleted). If you are looking at for example sys.dm_exec_sql_text() you should also get start_offset and end_offset values that will allow you to pinpoint the actual text that is being executed as part of the call, and there are also ways to see the actual call but it depends largely on how you are monitoring now and how you are sending your procedure calls to SQL Server.

share|improve this answer
Ah, that makes sense, thank you. I was using fn_get_sql, though I won't anymore since it appears the DMF you mention is a replacement. How would I also return the start and end offset? – Colin Feb 14 '12 at 1:55
Nevermind, found it in sys.dm_exec_query_stats – Colin Feb 14 '12 at 1:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.