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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 No more IF EXISTS on stored procedure drop/create?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

384 Posts

Posted - 03/26/2013 :  17:31:35  Show Profile  Reply with Quote
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.

Flowing Fount of Yak Knowledge

2242 Posts

Posted - 03/27/2013 :  01:10:17  Show Profile  Reply with Quote
Check this link
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000