In SSMS 2005, set the "Include IF NOT EXISTS clause" to false ALWAYS

This is a frustrating UI experience, setting the "Include IF NOT EXISTS clause" to TRUE in the scripting options of SSMS 2005 results in the following when using a Modify or any scripting options:

While it does wrap an IF NOT EXISTS statement(a safety check and a  must) it deserializes the stored procedure to be executed inside  an sp_executesql command. This sucks, since you have to manually remove all of the text before the ALTER and text after the last delimiter everytime you're going to modify something, worse if the sql contains literal strings you have to manually search/replace all the single quote delimeter.  I had to uninstall SSMSToolpack (great add-in) which I thought was the culprit, but the thing still remains.

Good thing I was helped by Tibor Karzi and pointed me to disable that setting. This UX change was already logged as an issue way back in 2007, it was reported in SP2 mine is already in SP3. I'm not sure if this still happens in SSMS 2008 though.

Hope this helps 

Published 05-13-2009 11:49 PM by bonskijr

Comments

# In SSMS 2005, set the

You've been kicked (a good thing) - Trackback from DotNetKicks.com

Wednesday, May 13, 2009 8:18 AM by DotNetKicks.com