0 being treat as Null value

I have a VB application that copies data from a table on server A to a table on server B. Whenever the value to be copied from server A is 0 it is written to server B as a Null value. I have tested the application on another PC (using different SQL servers) but cannot replicate the problem (the value is correctly written as a 0).

Is there a setting in SQL Server that treats values of 0 as Null values? If there is how do I turn it off?

Thanks,

Louise
louiserutherfordAsked:
Who is Participating?
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.

ShogunWadeCommented:
There is no such setting.   It must be a difference in your code.
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
ShogunWadeCommented:
can you post us the code and the DDL for the tables
0
louiserutherfordAuthor Commented:
I'm using exactly the same code, and have even tried using the same data. On one set of severs it works fine, on the other set it writes nulls.

There is too much code to post.

If there is no setting that writes null instead of zero then I will test the code further and hopefully replicate the problem on my test server.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

LowfatspreadCommented:
yes and confirm that no triggers are involved.
0
ShogunWadeCommented:
Are you definately inserting the value 0 or are you inserting a NULL with is intepreted as a 0.   (in the case of the latter this could be a DEFAULT (0) on the column)
0
louiserutherfordAuthor Commented:
Thank you both for your help. The problem was in the code. I was using the IsEmpty() function which appears to read 0 as empty! I have changed the code and it is working fine.
I have no idea why it was working with one set of servers but not the other.
0
ShogunWadeCommented:
your welcome.
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.