0

I am very new at SQL and keep getting erors when I try to change some text in my dataqbase for every instance. I was told my syntax was incorrect:

I am tryingto change the text in the lst link to the second link.

UPDATE dbo.qanda

SELECT Replace(‘http://vhahacnonva.vha.med.va.gov/’, ‘http://nonvacare.hac.med.va.gov/

  • Is this what you are looking for? - http://stackoverflow.com/questions/814548/how-to-replace-a-string-in-a-sql-server-table-column – Chubby Boy Jun 11 '13 at 18:33

1 Answers1

2

You are using a wrong REPLACE syntax. Also check your backtick, they should be quotes instead. Try this syntax

UPDATE dbo.qanda
SET columnname = REPLACE(columnname, 'http://vhahacnonva.vha.med.va.gov/', 'http://nonvacare.hac.med.va.gov/');

Just change columnname with your actual column name.

Fabio
  • 23,183
  • 12
  • 55
  • 64