July 10, 2014 at 10:28 am
All of a sudden hen I script out a Stored Procedure it encloses strings (edit) in Double Quotes?
For example
ANDPromo.[Group] IN (''FL_Small'',''FL_Large'')
Also it generates this code that I do not want. I just was Create Procedure...
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_IncentiveReport]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
What options do I need to set?
Thank you.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 10, 2014 at 11:06 am
Odd, is there anything in Tools > Options > SQL Server Object Explorer > Scripting ?
July 10, 2014 at 11:19 am
Welsh Corgi (7/10/2014)
All of a sudden hen I script out a Stored Procedure it encloses stings in Double Quotes?For example
ANDPromo.[Group] IN (''FL_Small'',''FL_Large'')
Also it generates this code that I do not want. I just was Create Procedure...
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_IncentiveReport]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
What options do I need to set?
Thank you.
How are you scripting out the stored procedure?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 10, 2014 at 11:20 am
if SSMS scripting option below is selected, then dynamic SQL is generated to handle the if not exists, and that is what you are seeing.
you pasted just a piece of the inner command, but the entire script is all dynamic SQL except for the object checking.
Lowell
July 10, 2014 at 11:23 am
I want:
ANDPromo.[Group] IN ('FL_Small','FL_Large')
Not:
ANDPromo.[Group] IN (''FL_Small'',''FL_Large'')
The later throws a syntax error. I have not changed anything.
Thanks.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 10, 2014 at 11:42 am
I changed the default on the script. I'm not sure how that changed. Thanks.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply