We help IT Professionals succeed at work.
Get Started

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

Eric Bourland
on
339 Views
Last Modified: 2012-05-11
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
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2015
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE