I am trying to update all records in a column so that they start with ‘CD’ e.g. DCE206 would become CDE206.
UPDATE table
SET column = REPLACE(column1, 'DC', 'CD')
WHERE column1 LIKE 'DC%'
I am using the above update statement however the following error appears
‘Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.’
Is there anything I can change in the statement to make this happen or do I need to look into using a cursor.
I am using SQL Server 2000.
You can’t possibly be getting this error from that code. The error msut be from some other peice of code.
Do you have anything than runs on update? A trigger?