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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Splitting an address field

Author  Topic 

wotrac
Yak Posting Veteran

98 Posts

Posted - 2005-01-13 : 16:22:46
I have a SQL Table where the address has been set up as 1 field
containing carriage returns.
I need to create a view which splits up this 1 field into sperate fields for each line of the address.All of the fields have differnt nubers of carriage returns.

Can anyone suggest the most efficient way of achieving this

nr
SQLTeam MVY

12543 Posts

Posted - 2005-01-13 : 17:57:09
see
http://www.mindsdoor.net/SQLTsql/f_GetEntryDelimiitted.html

You can use crlf as the delimitter to get back lines of the address.
Not very efficient but very easy to code.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -