Avatar of Eric Bourland
Eric Bourland
Flag for United States of America

asked on 

How to update multiple records in a column with value "NULL"?

ColdFusion 9
MS SQL Server 2005

* I have a table, tbl_Document_Has_Topic, with 923 records.

* That table has column DocumentTopicID.

* In 422 records, column DocumentTopicID has value: 3

In column DocumentTopicID I want to replace all values "3" with values "NULL". I don't want to edit each record. Is there an UPDATE command that I can use, to update this table column?

Does this look right to you?

UPDATE tbl_Document_Has_Topic
SET DocumentTopicID = "NULL"
WHERE     (DocumentTopicID = 3)

This table is in production; I am trying to undo the client's repetitive work to populate column DocumentTopicID with value = 3. I wanted to run this by some experts before I proceed. I have made a backup of the table. I am using SQL Server Studio Manager 2005 to edit the database.

Thanks as always.

Eric B
ColdFusion Language

Avatar of undefined
Last Comment
Eric Bourland

8/22/2022 - Mon