Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Return A Table

2 views
Skip to first unread message

rajkiranpro

unread,
Dec 3, 2008, 7:18:43 PM12/3/08
to
I have a value in a field which is a string.

the string is formed by reading from a csv file and it is delimited by a
";".

say the format is
Name;Address;Phone;PinCode

so that I have

1. name1,addr1,ph1,pc1
2. name2,addr2,ph2,pc2
3. name3,addr3,ph3,pc3

what need I a view created such that it has four columns Name Address Phone
And Pincode

I have the code to split the delimited text and do some functions on it..

I want to integrate in sql so that when I give "select * from parsedtable"
I get the result in the four column format.

Regards
Rajkiran

Bob Beauchemin

unread,
Dec 3, 2008, 11:24:38 PM12/3/08
to
You can do this with a SQLCLR table-valued function
(http://msdn.microsoft.com/en-us/library/ms131103(SQL.90).aspx) or with a
SQLCLR stored proc that uses SqlDataRecord and SqlMetaData to synthesize a
rowset (http://msdn.microsoft.com/en-us/library/ms131105(SQL.90).aspx). You
could also do this with a T-SQL multistatement TVF, but is this case, SQLCLR
code will likely be faster.

Cheers,
Bob Beauchemin
SQLskills

"rajkiranpro" <rajki...@hotmail.com> wrote in message
news:D67ED446-CD78-41F2...@microsoft.com...

0 new messages