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 2000 Forums
 SQL Server Development (2000)
 Resultset truncates select of varchars > 255 characters

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-08 : 10:15:15
TJ writes "I'm having problems trying to select varchar value greater than
255 characters.

The select statement truncates the resultset.

The original query is part of a stored procedure where a cursor is used to concate several strings, however the same problem occurs is the the example below (The last line 'Nr 5' is not returned in the resultset).

Query:

DECLARE @TEMP AS VARCHAR(1000)
SET @TEMP = 'A VEEEEERY LOONG STRING XXX VIOLIN I SODERTALJE LGH NR 1
A VEEEEERY LOONG STRING XXX VIOLIN I SODERTALJE LGH NR 2
A VEEEEERY LOONG STRING XXX VIOLIN I SODERTALJE LGH NR 3
A VEEEEERY LOONG STRING XXX VIOLIN I SODERTALJE LGH NR 4
A VEEEEERY LOONG STRING XXX VIOLIN I SODERTALJE LGH NR 5'

SELECT LEN(@TEMP) as length
SELECT @TEMP as string

Resultset:

length
-----------
334

string A VEEEEERY LOONG STRING XXX VIOLIN I SODERTALJE LGH NR 1
A VEEEEERY LOONG STRING XXX VIOLIN I SODERTALJE LGH NR 2
A VEEEEERY LOONG STRING XXX VIOLIN I SODERTALJE LGH NR 3
A VEEEEERY LOONG STRING XXX VIOLIN I SODERTALJE LGH NR 4

I just don't get it !!
any help on the subject will be appreciated

TJ"

smccreadie
Aged Yak Warrior

505 Posts

Posted - 2002-01-08 : 10:26:54
It sounds like it might just be your display settings in Query Analyzer. (I'm assuming that's what you're using). Under the Tools -> Options menu there's a place to set the max length of the output. Check this first.

Go to Top of Page
   

- Advertisement -