Updating 0 value to Null

Hi While I was try to change the 0 value in the column to Null, It gave me this error, if you could advise me with this error, would much appreciate :)

Capture.PNG
Just_flowAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pcelbaCommented:
Replaces column does not contain numeric data type values probably. What is the Replaces data type?

You may try following

UPDATE btn_pricing$  SET Replaces = NULL WHERE Replaces = '0'

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jim HornMicrosoft SQL Server Data DudeCommented:
The error occurs because an update action attempted to convert a value to an integer that cannot be converted, i.e. '49377-08120' with the dash makes it non-numeric.  

What is the data type of Replaces?  If that query is indeed the source of an error, then setting it to 0 when it's a character type means implicit conversion, and if any value in that column can't be converted to an int it will throw an error.  If so, then ... WHERE Replaces = '0' would be a better choice.

As an aside, punctuation marks such as $ in table names is not good programming practice, as it forces the developer to use square brackets [ ] surrounding the value, which is one thing to potentially forget and throw an error.
Scott PletcherSenior DBACommented:
pcelba's answer should work for you.
Just_flowAuthor Commented:
Thanks guys, I figured it out that I missed ' ' :/
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.