Dropping stored procedure? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Dropping stored procedure?

Can I drop a stored procedure when others are running it? Thanks.

It is not advisable. If you want to drop it make sure it is not referenced by any source
Madhivanan Failing to plan is Planning to fail
Why? —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Ich unterstütze PASS Deutschland e.V. http://www.sqlpass.de)

Yes you can as it is cached in memory, but I would like to know response for Frank’s question. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
quote:Originally posted by FrankKalis Why? —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Ich unterstütze PASS Deutschland e.V. http://www.sqlpass.de)

That stored procedure is dynamically created based on some user-defined settings. So, it is possible that the stored procedure will be changed anytime while someone is running it.
Thanks.
That sounds strange and interesting at the same time. Have you considered the use of a temporary stored procedure? —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Ich unterstütze PASS Deutschland e.V. http://www.sqlpass.de)

agree with Frank. While it might not cause a problem during testing, it probably will when activity on the db is heavy, and 2 years down the line when you dont understand whats hapenning it will suddenly be a much greater headache to find
]]>