Muhammad Abbas - Data Engineering Architect
Pages
CV
Profile
BLOG
Search This Blog
Wednesday, October 13, 2010
[T-SQL] How to generate CSV from Table Data
Here is a very simple code:
DECLARE @Str VARCHAR(MAX)
SELECT @Str = COALESCE(@Str+',' , '') + FieldName
FROM TableName
SELECT @Str
*Field Name should be replaced with Field Name
*Table Name should be replaced with Table Name
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment