I've inherited an application that calls a number of stored procedures. In quite a few of them I've been finding updates that look like the following:
UPDATE tbl_name
SET field_name = 'some value'
FROM tbl_name WITH (NOLOCK)
WHERE field_name = 'some other value'
I didn't think you could use the "WITH (NOLOCK)" hint when UPDATING,DELETTING or INSERTING.
Should the UPDATE be re-written to:
UPDATE tbl_name
SET field_name = 'some value'
WHERE field_name = 'some other value'
or can I just ignore it?
UPDATE tbl_name
SET field_name = 'some value'
FROM tbl_name WITH (NOLOCK)
WHERE field_name = 'some other value'
I didn't think you could use the "WITH (NOLOCK)" hint when UPDATING,DELETTING or INSERTING.
Should the UPDATE be re-written to:
UPDATE tbl_name
SET field_name = 'some value'
WHERE field_name = 'some other value'
or can I just ignore it?