SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 No more IF EXISTS on stored procedure drop/create?
 New Topic  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

2241 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  
 New 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.03 seconds. Powered By: Snitz Forums 2000