My Question is simple! How to Drop a Temporary Stored Procedure If Exists ? This is because while I create a Temporary SP in a script, it throws error like 'There is already an object named '#sp_name' in the database' while i run the Second time. I dont want to show this message to users. Please help me. Your solution is Highly appereciated!
3条答案
按热度按时间jjhzyzn01#
The temp procs are dropped in the same way as permanent procs are dropped. Please see the code below:
jbose2ul2#
NOT 2005 but with modern SQL server you can do:
kxeu7u2r3#