Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Word wrap problem

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2009-11-05 : 09:19:44
How to do Word wrap is always cofused me.
For example, can someone help me to fix it?

N' INSERT INTO A6 ( CLAIMNO_HFK, CLAIMNO, SEQUENCE, SUBJECT, NOTES,'+ N' SECURED_YN, NOTSHARED_YN, ' +
N' CREATEBY, CREATEDATE, LASTCHANGEBY,LASTCHANGEDATE )' +
N' VALUES (@myclaimno, @myclaimno, 1, @sourcedesc,' +
N' @sourcedesc + ' ~ ' + @issuedesc + ' ~ ' + CAST(@note AS CHAR)'+ + N' '~ Please process as noted. ~ '' +
N' @operatorname + '~ ' + @date ,0,0,@operatorid, @rcvdate,' +
N' @operatorid, @rcvdate)'

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-05 : 09:56:12
Didn't get you.



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2009-11-05 : 10:30:27
I want to use sp_executesql to run it.

Declare @sql nvarchar(2000)
set @sql =

N' INSERT INTO A6 ( CLAIMNO_HFK, CLAIMNO, SEQUENCE, SUBJECT, NOTES,'+ N' SECURED_YN, NOTSHARED_YN, ' +
N' CREATEBY, CREATEDATE, LASTCHANGEBY,LASTCHANGEDATE )' +
N' VALUES (@myclaimno, @myclaimno, 1, @sourcedesc,' +
N' @sourcedesc + ' ~ ' + @issuedesc + ' ~ ' + CAST(@note AS CHAR)'+ + N' '~ Please process as noted. ~ '' +
N' @operatorname + '~ ' + @date ,0,0,@operatorid, @rcvdate,' +
N' @operatorid, @rcvdate)'

exec sp_executesql @sql

It do not work.

But original code is works:

INSERT INTO C6 ( CLAIMNO_HFK, CLAIMNO, SEQUENCE, SUBJECT, NOTES, SECURED_YN, NOTSHARED_YN,
CREATEBY, CREATEDATE, LASTCHANGEBY, LASTCHANGEDATE )
VALUES (@myclaimno, @myclaimno, 1, @sourcedesc,
@sourcedesc + ' ~ ' + @issuedesc + ' ~ ' + CAST(@note AS CHAR) + ' ~ Please process as noted. ~ ' + @operatorname + '~ ' + @date ,0,0,@operatorid, @rcvdate, @operatorid, @rcvdate)

Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-11-05 : 10:40:35
do following
PRINT @sql
exec sp_executesql @sql

and post back the value of @sql that you get in the Messages tab


<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -