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 2000 Forums
 Transact-SQL (2000)
 How to split the value

Author  Topic 

maryxu
Starting Member

36 Posts

Posted - 2009-12-08 : 10:37:56
currently i have a row with this value

"AUDITR" "0287" "Location 01 Auditor ,Location 16 Auditor,Location 19 Auditor", this row has three columns, one of the column could or could not have the value with comma delimited value, so i would like to parse this column, then make it insert into another table with the first two columns value, like this with three rows, three column. i could have function created to parse the string and return a table with the value, but don't know how to insert to a new table.

AUDITR 0287 Location 01 Auditor
AUDITR 0287 Location 16 Auditor
AUDITR 0287 Location 19 Auditor

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-12-09 : 09:13:44
Create the table you want to insert the values into first.
Then
INSERT INTO thatTable
SELECT <values>
FROM
parsedTable

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -