user712027
user712027

Reputation: 572

TSQL: update a column to null

A learner here. This has to be esasy but I cannot figure it out.

I have a table like this:

ID -- NAME -- CHOICE
1 -- John -- book
2 -- Matt -- pen
3 -- Linda -- bag
.
.

What would be the script to turn all the data in column CHOICE to null?

Thanks a ton

Upvotes: 10

Views: 37314

Answers (1)

AdaTheDev
AdaTheDev

Reputation: 147224

You'd use an UPDATE statement, without a WHERE clause (so it updates every single row)

UPDATE YourTable
SET Choice = NULL

Upvotes: 24

Related Questions