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 |
|
cagdasal
Starting Member
2 Posts |
Posted - 2008-11-17 : 11:24:26
|
| Hello there, i am currently passing in a parameter to a stored procedure which could look something like this for example:''a'',''b'',''b''What i would like to do is remove the '' and place it with a single ' so i can use this string in a query quch as:WHERE xxxx in (@param)However if i do this:(REPLACE(@clients, '''','''))It obviously does not work since it is recognising each ' as an opening quotationThe reason for the duplicate single quotes is just the way the software i am using is passing them in.Any ideas on how to get around this?Any help would be greatly appreciated.p.s. i am using SQL server 2005 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-17 : 11:32:41
|
cant you just use?WHERE ','+REPLACE(@clients, '''''','')+',' LIKE '%,'+ xxxx + ',%' |
 |
|
|
cagdasal
Starting Member
2 Posts |
Posted - 2008-11-17 : 12:29:44
|
| I dont really know how that would work, basically i want to convert:''a'',''b'',''c'' into 'a','b','c'Thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-17 : 12:34:54
|
quote: Originally posted by cagdasal I dont really know how that would work, basically i want to convert:''a'',''b'',''c'' into 'a','b','c'Thanks
Try it and see |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-11-17 : 13:23:27
|
REPLACE(@Clients, CHAR(34), CHAR(39)) E 12°55'05.63"N 56°04'39.26" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-18 : 04:16:54
|
| http://sqlblogcasts.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspxMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|