Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Good morning, this is my first post so I hope its in the correct place. I have a address column in one of my databases that I need to split out by carriadge return but don't know what to startThis is my example querySELECT AddressFROM PUB."Address" Where "Id" = 123456Results3 The StreetMayfairLondonEnglandI would like the results to showEither3 The StreetMayfairLondonEnglandOr the same but horizontalCan anyone helpThanksDJ
gbritton
Master Smack Fu Yak Hacker
2780 Posts
Posted - 2014-09-18 : 09:31:14
So, you have embedded CRs in your data? See this article about a splitter function and see if you can apply it to some of your data. http://www.sqlservercentral.com/articles/Tally+Table/72993/Your revised query might be something like: