Wednesday, March 28, 2012

Script wackiness

I have tried to script all the tables and stored procedures from several
SQL2005 dbs and I noticed that I get double-quotes for single quotes and a
lot of extra single quotes near the END statements -- making the whole thing
unusable. Anyone know what this is?Could you please post some code ?
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
--|||Here are some examples. What the sprocs do is irrelevant, they've been used
for a long time. But this is script output from 2005 (previously scripted in
from 2000).
*****************************************
CAST(IsNull(ME.ActualH,0) AS nvarchar(5))+'' ''+
CASE
WHEN ActualHFrac = 0 THEN ''''
WHEN ActualHFrac = 0.0625 THEN ''1/16''
...
/* note the double quotes for singles */
******************************************
...
COMMIT TRANSACTION
SELECT @.err = @.@.error
IF @.err <> 0
RETURN @.err
'
END
/* note the wacky little single quote before END, this does not show in 2000
output */
******************************************
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =OBJECT_ID(N'[dbo].[sel_ContactBrandsCRM]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @.statement = N'
CREATE PROCEDURE [dbo].[sel_ContactBrandsCRM]
@.ContactID int,
@.SaleID int
AS
...
/* note the single quote after the N on the EXEC line */
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1168464966.601900.217650@.p59g2000hsd.googlegroups.com...
> Could you please post some code ?
> HTH, Jens K. Suessmeyer.
>
> --
> http://www.sqlserver2005.de
> --
>|||Hi
you told that the scripts are unusable, if that means that the script
break on execution or creation you will have to use the SET
QUOtED_IDENTIFIERS OFF option .
HTH, Jens K. Suessmeyer.
--
http://www.sqlserver2005.de
--

No comments:

Post a Comment