Avatar of tommym121
tommym121
Flag for Canada asked on

SQL - how to turn a delimited string into rows of a table

I have a string like 'item 1,item 2,item 3,item 4' into rows of a table (say MyTable) so when
I

Select * From MyTable

I will get

Item 1
Item 2
Item 3
Item 4
Microsoft SQL ServerMicrosoft SQL Server 2005

Avatar of undefined
Last Comment
tommym121

8/22/2022 - Mon
sventhan

tommym121

ASKER
Seventhan,

I read the article, but still not sure how to use pivot or unpivot to achieve the result.

Would you be able to show me with an example.  Thanks.
ASKER CERTIFIED SOLUTION
vasto

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
tommym121

ASKER
thanks.  Got it.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck