I'm trying to create a stored procedure to quickly insert some data into my DB and just having a little trouble figuring out the quickest way to do this.
Into table one I insert a bunch of data about a file and return the new ID of that file.
I then have a separate table that tracks which versions of the app that file is compatible with.
This table has two columns
FileID, Version
Let's say the returned FileID = 1 in this instance.
The Version String will look like this
"1.1, 1.2, 2.1, 2.2"
Essentially I want to split that string and loop it so it ends up as 4 rows like this
FileID | Version |
---|---|
1 | 1.1 |
1 | 1.2 |
1 | 2.1 |
1 | 2.2 |