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 |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2009-04-09 : 04:33:59
|
| Hi,The sql below replaces the 'AND' with 'OR'declare @sql varchar(100)set @sql = 'not "Ireland" AND "london" or "tokyo"'print replace(@sql, 'AND', 'OR')This is what I get. Notice that I do NOT want the word Ireland to change as it has and in itnot "irelOR" OR "london" or "tokyo"The result should be:not "ireland" OR "london" or "tokyo"How can I solve this please?Thanks |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-09 : 05:05:16
|
| declare @sql varchar(100)set @sql = 'not "Ireland" AND "london" or "tokyo"'print replace(@sql, ' AND ', ' OR ')MadhivananFailing to plan is Planning to fail |
 |
|
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2009-04-09 : 05:27:27
|
| Many thanks |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-09 : 06:07:02
|
quote: Originally posted by arkiboys Many thanks
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|