question

Flathead_SQL avatar image
Flathead_SQL asked

SSMS Scripting with Unicode?

When right-clicking and selecting modify on a stored proc in SSMS 2014, the script is generated in a new window but uses the sp_executesql statement with the Unicode N' format. I've never had this happen in previous versions of SSMS but I'm hoping it's just a setting I may have changed unintentionally. As an FYI, what I am wanting is that when I right click to modify a stored proc, that it is generated in a new window (works fine now) but doesn't enclose everything in the N' format so I can easily copy and paste portions of the script or modify them without having to put the extra ' marks around in char values in the proc.
ssmssql-server-2014
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
DenisT avatar image
DenisT answered
I am not sure how it looks like in SSMS 2014 but in 2008 R2 it's under Tool --> Options --> SQL Server Object Explorer --> Scripting and the option is called Include IF NOT EXISTS clause. Set it to False!
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I never use this abbreviation, but OMG!! What the #$@@ kind of setting is that?? I didn't even think about that setting, really thought that would just add a check and a drop if the object existed but why put the proc text in a Unicode wrapper like that??? Weird, but thank you very much!
1 Like 1 ·
I think because you cannot use ALTER PROCEDURE between BEGIN/END IF EXISTS () BEGIN ALTER PROCEDURE AS ... statement ... END GO
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.