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)
 Join all records in field into a big text (string)

Author  Topic 

MIB
Starting Member

4 Posts

Posted - 2002-09-24 : 23:21:22
Hi
If I have a Table1 with Field1 as below
Field1
A
B
C

I want to write a SQL to display ABC. (join all records in Field1 together)

Thank You

MIB
Starting Member

4 Posts

Posted - 2002-09-25 : 00:55:20
I done it by using cursor...any solution without use cursor?

thanks

Go to Top of Page

marileng
Starting Member

28 Posts

Posted - 2002-09-25 : 02:21:15
Declare @Field1 Varchar(200)
Set @Field1= ''
Update Table1
Set @Field1 = @field1 + field1
print @Field1

Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-09-25 : 07:40:36
Using COALESCE to Build Comma-Delimited String

Jay White
{0}
Go to Top of Page
   

- Advertisement -