Can some one help ith this

I have a table with  columns
when I do a select * out put ill be like this
id msg
1 la\ca\us
2 lon\lon\uk

Is it possible to have output like this .Basically there should be only 2 rows but where there is a '\'  it should show up below
1 la
   ca
   us
2 lon
   lon
   uk

Can some one help
vijay11Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheAmeobaCommented:
I don't know of a way to do that with the SQL command, but once you have the values you should be able to use a simple string replace command to replace the / with the new line character before outputting it or using it in your program.

What language are you developing in?
0
Patrick MatthewsCommented:
vijay11,

You could run a query like this:

SELECT id, REPLACE(msg, '\', CHAR(13) + CHAR(10)) AS msg
FROM SomeTable

Open in new window


If your presentation layer supports line breaks and text wrapping, that would produce the output you seek.

Depending on your presentation layer, you might need to replace only with CHAR(13) or only with CHAR(10).

Patrick
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vijay11Author Commented:
How can I update this column in the table
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.