From: Nancy on
Oops. I guess I need to add line-feeds to my text:
My database has just been moved from a regular server
running SQL Server 2005 to a virtual server running SQL
server 2005. I have been getting calls today because
integer fields that are set to NOT allow nulls and have
a default value of 0 --- defined in the table as ((0)) --
are not being set to the default value when writing a
new record where the not nullable integer field has NOT
been specified. Is there something that must be set up
on this virtual server to trigger the use of the default
value? I am simply not specifying this field in the
insert and expecting it to default to 0 which is the
default value. I get the 'trying to insert null into
not nullable field' error message. Anyone got any
wisdom to offer?



Nancy Moore wrote:

Default values not being applied on insert in SQL 2005 virtual server
29-Mar-10

My database has just been moved from a regular server running SQL Server 2005 to a virtual server running SQL server 2005. I have been getting calls today because integer fields that are set to NOT allow nulls and have a default value of 0 --- defined in the table as ((0)) -- are not being set to the default value when writing a new record where the not nullable integer field has NOT been specified. Is there something that must be set up on this virtual server to trigger the use of the default value? I am simply not specifying this field in the insert and expecting it to default to 0 which is the default value. I get the 'trying to insert null into not nullable field' error message. Anyone got any wisdom to offer?

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Circular Progress Indicator
http://www.eggheadcafe.com/tutorials/aspnet/4d89b4cb-ba59-4362-ab0a-cc047643fd42/wpf-circular-progress-ind.aspx
From: Uri Dimant on
Hi
I have seen such things on SQL Server 2000 with Linked server, I think you
need to specify those values explicity

<Nancy Moore> wrote in message
news:2010329142918nancy.moore(a)colliersheriff.org...
> Oops. I guess I need to add line-feeds to my text:
> My database has just been moved from a regular server
> running SQL Server 2005 to a virtual server running SQL
> server 2005. I have been getting calls today because
> integer fields that are set to NOT allow nulls and have
> a default value of 0 --- defined in the table as ((0)) --
> are not being set to the default value when writing a
> new record where the not nullable integer field has NOT
> been specified. Is there something that must be set up
> on this virtual server to trigger the use of the default
> value? I am simply not specifying this field in the
> insert and expecting it to default to 0 which is the
> default value. I get the 'trying to insert null into
> not nullable field' error message. Anyone got any
> wisdom to offer?
>
>
>
> Nancy Moore wrote:
>
> Default values not being applied on insert in SQL 2005 virtual server
> 29-Mar-10
>
> My database has just been moved from a regular server running SQL Server
> 2005 to a virtual server running SQL server 2005. I have been getting
> calls today because integer fields that are set to NOT allow nulls and
> have a default value of 0 --- defined in the table as ((0)) -- are not
> being set to the default value when writing a new record where the not
> nullable integer field has NOT been specified. Is there something that
> must be set up on this virtual server to trigger the use of the default
> value? I am simply not specifying this field in the insert and expecting
> it to default to 0 which is the default value. I get the 'trying to
> insert null into not nullable field' error message. Anyone got any wisdom
> to offer?
>
> Previous Posts In This Thread:
>
>
> Submitted via EggHeadCafe - Software Developer Portal of Choice
> WPF Circular Progress Indicator
> http://www.eggheadcafe.com/tutorials/aspnet/4d89b4cb-ba59-4362-ab0a-cc047643fd42/wpf-circular-progress-ind.aspx