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.
| Author |
Topic |
|
pug2694328
Posting Yak Master
166 Posts |
Posted - 2006-02-16 : 11:30:17
|
| I'm trying to convert a single variable with names delimited by spaces each into a separate variable.In other platforms I've used the LOCATE function along with substring, but it doesn't seem to be available in SQL Server.Example:DECLARE @LIST VARCHAR(200)SET @LIST = 'NAME1 NAME2 NAME3'I'd like to either have them in a table:NAMENAME1NAME2NAME3or even better in separate dynamically DECLAREd globals (I can get them there from a table of course):@NAME1 = 'NAME1'@NAME2 = 'NAME2'@NAME3 = 'NAME3'Any Ideas? |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2006-02-16 : 11:33:58
|
| Use a Splitter function, search this site and you'll find a few.. |
 |
|
|
Kristen
Test
22859 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
pug2694328
Posting Yak Master
166 Posts |
Posted - 2006-02-17 : 10:17:59
|
| Thanks! |
 |
|
|
|
|
|