How to separate values by new line and split to new row in SQL Server. I have the following data
Ticket | Agent |
---|---|
98765 | Agent1 Agent2 Agent3 |
12345 | Agent4 Agent5 Agent6 |
Or as below
Now I have to convert it into the following -
Ticket | Agent |
---|---|
98765 | Agent1 |
98765 | Agent2 |
98765 | Agent3 |
12345 | Agent4 |
12345 | Agent5 |
12345 | Agent6 |