JMK
JMK

Reputation: 28059

Simple SQL query not executing

I am familiar with MySQL, and was under the impression that Microsoft SQL wasn't that different in syntax for the simple stuff.

So whenever I wanted to update the Published field (a boolean) on every row on a table called Country to false, I did this:

UPDATE Country SET Published = false;

When I execute the query, I get this error:

Error

What am I doing wrong?

Thanks

Upvotes: 1

Views: 92

Answers (2)

pero
pero

Reputation: 4259

Add [ and ]

UPDATE Country SET [Published] = false;

Upvotes: 0

John Woo
John Woo

Reputation: 263723

Wrap the value for Published with single quote,

UPDATE Country SET Published = 'false';

Upvotes: 3

Related Questions