June 28, 2004 at 12:23 pm
Hi,
I am trying the following:
Declare @test-2 varchar(8000)
Set @test-2='SELECT VIOXX_LastName + '' + VIOXX_FirstName + '' + CONVERT(varchar(50), VIOXX_Number) AS PlaintiffsName, VIOXX_Number
FROM tblPlaintiff WHERE VIOXX_Number NOT IN(SELECT VIOXX_Number FROM tblCase_Plaintiff) OR
VIOXX_Number IN (SELECT tblCase_Plaintiff.VIOXX_Number FROM tblCase INNER JOIN tblCase_Plaintiff ON tblCase.Case_Number = tblCase_Plaintiff.Case_Number
WHERE (tblCase.Status = ''InActive'')) ORDER BY VIOXX_Number, VIOXX_LastName'
When I exec the following:
Select @test-2
I got the following result:
SELECT VIOXX_LastName + ' + VIOXX_FirstName + ' + CONVERT(varchar(50), VIOXX_Number) AS PlaintiffsName, VIOXX_Number
FROM tblPlaintiff WHERE VIOXX_Number NOT IN(SELECT VIOXX_Number FROM tblCase_Plaintiff) OR
VIOXX_Number IN (SELECT
Any ideas? Any limitations on the number of characters for a local variable in TSQL?
Thanks in advance.
June 28, 2004 at 12:52 pm
That 8000 characters includes white space and some white space characters can break your SQL.
The only problems I have had are when unicode text (which takes twice as much space) gets truncated.
June 28, 2004 at 1:01 pm
The problem is not with the white space. I did a 'Select len(@Test)' and I got 434, which is not even 10 percent of the 8000 characters.
June 28, 2004 at 2:37 pm
Query Analyzer --> Tools --> Options --> Results --> Maximum Characters per Column.
It's probably correct, it's just truncating the 1 colimn result at 256 Characters !!!!!!
KlK
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy