Paarthasarathy (7/20/2010)
Hi,I have a need to split a varchar column into multiple columns based on a delimiter.
Hi have a variable named @a varchar(max)
it contains value similar to below
select @a = '1,a,b,20080101|2,c,d,20080102|3,e,f,20080102'
like i need to insert it into a table
with columns( a1 int, a2 char, a3 char, a4 datetime)
Is it worth writing a function with user defined table valued parameter or any other thoughts?
I would be happy to receive codes for accomplishing this?
Please see the following "how to" article for a T-SQL only solution...
http://www.sqlservercentral.com/articles/T-SQL/63003/
--Jeff Moden
Change is inevitable... Change for the better is not.