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 |
|
dass05555
Yak Posting Veteran
55 Posts |
Posted - 2008-06-16 : 03:04:06
|
| Dear gurus,my problem is below,pls give me solutionif i give the values like@A='test1@test.com;test2@test.com;test3@test.com;test4@test.com;'i want to get like thismail_id--------test1@test.comtest2@test.comtest3@test.comtest4@test.comthanks in advance,cool..., |
|
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2008-06-16 : 03:19:36
|
| declare @mail as varchar(max)set @mail='test1@test.com;test2@test.com;test3@test.com;test4@test.com'declare @x xmlset @x='<i>' + replace(@mail,';','</i><i>') + '</i>'select @xselect x.i.value('.','varchar(50)') from @x.nodes('//i')x(i) |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|