By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,453 Members | 959 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,453 IT Pros & Developers. It's quick & easy.

spiting the data with comma separation in sql server

P: 22
Hello All,

How to split the data in a column with comma separation.
I am attaching the images for my Input and my expecting Output.

Input:
ID Group ProjectIds
1 xxx 1234,456,8972
2 yyy 567,7890,12
3 zzz 32,165
4 ppp 4567



Expected Output:
ID Group ProjectIds
1 xxx 1234
1 xxx 456
1 xxx 8972
2 yyy 567
2 yyy 7890
2 yyy 12
3 zzz 32
3 zzz 165
4 ppp 4567


Please help me how i will get my required output with "Sql Server" query


Thanks In Advance,
Phani Kumar.
Attached Images
File Type: png Input.png (2.8 KB, 106 views)
File Type: png Output.png (4.5 KB, 117 views)
Feb 11 '15 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
You got some options here

Happy Coding!!!


~~ CK
Feb 11 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.