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 2005 Forums
 Transact-SQL (2005)
 Extract csv values with multiple rows?

Author  Topic 

petre
Starting Member

11 Posts

Posted - 2010-09-30 : 01:52:09
hi friend,

i have the following csv value sent from the client:

@csv nvarchar(max)
set @csv
=
1,'hello, how are you?',23.44,f,1,'sfsfsdfssfs'
2,'c, d and q are not',2.34,t,1,'sdfss'
3,'c, e and a are not',34.8,f,1,'sdfss'
4,'i, j and k are not',5.77,f,1,'sdfss'

Note that the valeu in @csv is a multi line and multi columned. How do i extract these values
and store in temp table or return as a table from table-valeu fucntion?

PS: im SQL learner so please, commment and explain the SQL statements that you write :)

thank you

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-09-30 : 06:52:47
http://www.sqlteam.com/article/parsing-csv-values-into-multiple-rows
Go to Top of Page
   

- Advertisement -