SQL split column into multiple rows.

135365 pts.
Tags:
SQL
I'm going nuts.. I have a table with 30+ columns. 
One of the columns has a string with serial numbers that are comma separated. 
What I'm trying to do is create a new temp table with the identityID and the serial number. This way I can add each parsed out serial number value to our  production data with all the other column data carried over based on the parent records joining on the identityID. I've seen methods using CTE, Cross Apply, creating a function and more. I'm looking for something that performs well as the table has 1.7 million rows now before the split would be done. Once this is broken down I can then filter out multiple occurrence of the serial numbers. Still fairly new to SQL and this task has me puzzled. This would have been easy in RPG.

Here is where I stand now because I'm unsure of what direction to go.
-- Test  Table
DECLARE @SerialNumber_Table TABLE  (SerialNumbers_ID INT,SerialNumber char) 

-- Insert statement
INSERT INTO @SerialNumber_Table (SerialNumbers_ID,SerialNumber)
SELECT  
FROM  dbo.mySerialNumberTable  


Software/Hardware used:
sql
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: