I want to split the query result in MSSQL.
Example is below:
ID (PK)      BorrowID
1            1,3,4
2            4,5
3            2,3
4            1,6
5            2,7
I want to create new tables using upper table data.
NewID(PK)    ID      BorrowID
1            1       1
2            1       3
3            1       4
4            2       4
5            2       5
So I want to split the BorrowID Data to create new tables.
How can i get this?
I already try to use SUBSTRING, CHARINDEX function, but it doesn't well.
 
     
     
    