SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
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  

ajthepoolman
Constraint Violating Yak Guru

USA
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.

bandi
Flowing Fount of Yak Knowledge

India
2217 Posts

Posted - 03/27/2013 :  01:10:17  Show Profile  Reply with Quote
Check this link
http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/6e6c30b0-1c6b-4403-bacd-b1b8f3615098/
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.05 seconds. Powered By: Snitz Forums 2000