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)
 Query Help - SQL 2000

Author  Topic 

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-08 : 03:41:19
quote:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=128927



Hi

Try this...

DECLARE @VAR VARCHAR(100)
SELECT @VAR = ISNULL(@VAR+',','')+COLUMN_NAME FROM TABLE_NAME
SELECT @VAR



-------------------------
Your time is a valuable resource.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-07-08 : 04:08:10
quote:
Originally posted by rajdaksha

quote:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=128927



Hi

Try this...

DECLARE @VAR VARCHAR(100)
SELECT @VAR = ISNULL(@VAR+',','')+COLUMN_NAME FROM TABLE_NAME
SELECT @VAR



-------------------------
Your time is a valuable resource.

Make sure the variable has enough length to have concatenated data
But if OP wants to show data in front end application, concatenation should be done there


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -