SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Development Tools
 ASP.NET
 Setting SQL int value to 0 is not updating in the
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ianc22
Starting Member

United Kingdom
2 Posts

Posted - 04/29/2012 :  07:43:34  Show Profile  Reply with Quote
Hi,

I have an issue where an entry is not updating a column in the DB if the value is set to 0. The row is being updated as I attached an object and changed the Name column as well as setting the count column to 0 (it's currently set to 10). The name updated but the count stayed at 10. If I set the count to anything other than 0 it also gets updated...

Any ideas?!

sunitabeck
Flowing Fount of Yak Knowledge

5152 Posts

Posted - 04/29/2012 :  08:26:39  Show Profile  Reply with Quote
There is nothing is built into SQL Server that would cause a zero to be rejected and other values to be accepted, so it is something in your code.

It would be hard to offer any suggestions without seeing the code and the table structure. It may be that there is a code segment that checks for zero in the value passed in; or it could be a trigger on the table that reverts when a value of zero is inserted, or it could be anything in between.

Post the code and table DDLs and I am sure people on the forum would be able to offer suggestions. If you need some guidance in posting, Brett's blog would help: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

SQL Basic
Starting Member

Canada
8 Posts

Posted - 05/25/2012 :  05:47:29  Show Profile  Reply with Quote
Do you have set and change "0" value with "10" ?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000