Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 No more IF EXISTS on stored procedure drop/create?

Author  Topic 

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2013-03-26 : 17:31:35
I just noticed today that SQL 2012 adds DROP PROCEDURE when scripting a stored procedure, but it does not add the IF EXISTS check. So when you take your script to a production server, the stored procedure bombs because it is trying to drop something that is not there.

I went in to Options and told it to check for object existence and now everything is wrapped in dynamic SQL.

What the hell is Microsoft thinking? Is there a setting I am missing somewhere that will do a "regular" drop and create like 2008 R2 does?

Hey, it compiles.

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-03-27 : 01:10:17
Check this link
http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/6e6c30b0-1c6b-4403-bacd-b1b8f3615098/
Go to Top of Page
   

- Advertisement -