Take the 2-minute tour ×
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. It's 100% free, no registration required.

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.

Thanks.

share|improve this question

migrated from stackoverflow.com Feb 14 '12 at 20:28

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

1 Answer 1

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

 
discard

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.