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 |
shanmugaraj
Posting Yak Master
219 Posts |
Posted - 2013-04-22 : 00:58:51
|
In the below query, i need data with ltrim where 'Name, Location, Gender' is passed as parameter. I want them to be passed as 'Name,Location,Gender'SELECT CONVERT(xml,'<root><s>' + (REPLACE('Name, Location, Gender' ,',','</s><s>') + '</s></root>'))THANKSSHANMUGARAJnshanmugaraj@gmail.com |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-04-22 : 01:10:41
|
REPLACE('Name, Location, Gender', ', ', '</s><s>') -- here give one space after comma--Chandu |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-22 : 01:13:56
|
you need to strip space right? REPLACE('Name, Location, Gender', ', ', ',') ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
shanmugaraj
Posting Yak Master
219 Posts |
Posted - 2013-04-22 : 01:21:17
|
Thanks Chandu & VisakhTHANKSSHANMUGARAJnshanmugaraj@gmail.com |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-04-22 : 01:29:36
|
quote: Originally posted by shanmugaraj Thanks Chandu & VisakhTHANKSSHANMUGARAJnshanmugaraj@gmail.com
Welcome--Chandu |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-22 : 01:36:48
|
quote: Originally posted by shanmugaraj Thanks Chandu & VisakhTHANKSSHANMUGARAJnshanmugaraj@gmail.com
what was your intended result?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|
|
|