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
 Transact-SQL (2000)
 output greater then VARCHAR

Author  Topic 

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2004-12-06 : 05:52:34
I have a number of records, with content in col: COL1 VARCHAR(7200).
The number of records can vary.
I want to be able to output them in 1 select statement , such as SELECT content = @content

Obviously, if @content is a VARCHAR then there is a limit. In practise, some of the concatenation totals are 15000-20000 length.
Is there a way to output as 1 col in a SELECT statement? (without having to drag the recordset to the client program , iterate and concatenate on that side)

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-06 : 06:25:30
do you need to store it in a variable or just show the records?

will
select field1 + field2 +...
from tablename
serve the purpose?


--------------------
keeping it simple...
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2004-12-06 : 06:32:23
I don't particauarly need to store it in a variable, but I do need it to come out as 1 record.
So , in the table: row 1 = "hdhdhdh" , row2 = "jdjddjdj",row3 = "www" , I need this to come out as "hdhdhdhdjddjdjwww" , not knowing whether there will be 3 or 10 rows
Go to Top of Page
   

- Advertisement -