[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

Problems with MSSQL TSQL Replace Function

Hi All,

I'm trying to correct some text in a number of records within a MSSQL2008 database, but the following code, although saying 1 row afftected (a test row), it has not changed the record - The row contains the word 'Lunge' in the sentence, so cannot understand why it does not change it to 'Lounge' any ideas?!

Update web_metadata
set Meta_Description = REPLACE(Meta_Description,'Lunge','Lounge'),
    Meta_Keywords = REPLACE(Meta_Keywords,'Lunge','Lounge'),
    Meta_Title = REPLACE(Meta_Title,'Gywnydd','Lunge','Lounge'),
    Meta_URL = REPLACE(Meta_PageURLName,'Lunge','Lounge')
    where Meta_AreaCode = 'CITY' and Meta_CatCode = 'CARPET'


Regards

JamWales
0
Jamie
Asked:
Jamie
  • 3
  • 2
1 Solution
 
tigin44Commented:
did you check the trigger defined on the table. Probably s trigger preventing the update peration
0
 
Reza RadCommented:
what is your sample row data? could you paste it here?
0
 
JamieAuthor Commented:
Hi tigin44.
There doesn't appear to be any triggers defined on that table - plus I've updated the same rows using an asp script without problems.
Regards
JamWales
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
JamieAuthor Commented:
Hi reza_rad/tigin44,
Many thanks for your help - having been asked for a sample row I looked at the data again - and saw I had a spelling errror  which stopped the replace from working. Sorry I should have double checked this first. I feel a bit of a fool now!
Regards
JamWales
0
 
Reza RadCommented:
Glad to solve
Regards,
0
 
JamieAuthor Commented:
Pointed me in the right direction.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now