I have got a table with 3 columns. The first two columns are ID (Primary Key) and Country. The third column contains some names seprated by colon character. For example:
ID Country Names
--------------------------
1 USA Mike;Bill
2 USA Michael;Lara;Van
3 Italy Kobe;Nate;Tim;Manu
I need to write an SQL query that will generate a new row for each name. For example, in this case the output will be
ID Country Name
--------------------------
1 USA Mike
1 USA Bill
2 USA Michael
2 USA Lara
2 USA Van
3 Italy Kobe
3 Italy Nate
3 Italy Tim
3 Italy Manu
How can I do that? I have found a split function in t-sql which can split the string about a character. But how to split the data into multiple rows?