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
 General SQL Server Forums
 Script Library
 get string from query

Author  Topic 

chevolec
Starting Member

1 Post

Posted - 2004-10-11 : 13:37:41
Hi there, im trying to create a string from a query, i got a table like this one
id name
-- -----------
1 Robert DeNiro
2 Will Smith
3 Bruce Willis
4 Al Pacino

Now, i want to get this output

Robert Deniro; Will Smith; Bruce Willis; Al Pacino

I'm wondering if there is a way to acomplish this.

thanks Advanced

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2004-10-11 : 14:00:35
[code]declare @String varchar(8000); set @String = ''
Select @String = name+ '; ' + @String from <YourTable>[/code]
Go to Top of Page
   

- Advertisement -