Microsoft SSIS and Sql Server Notes
Showing posts with label
create list
.
Show all posts
Showing posts with label
create list
.
Show all posts
Monday, March 19, 2012
Create Comma Separated List- Sql tips and tricks
Create list of Integer type column
[code]
DECLARE @listStr VARCHAR(MAX)
SELECT @listStr = COALESCE(@listStr+',' ,'') + CAST(ColumnName AS Varchar(10))
FROM TableName
SELECT @listStr
GO
[/code]
Replace
ColumnName
and
TableName
Older Posts
Home
Subscribe to:
Posts (Atom)