I have a strange (well I think its strange) where I have create a field
(CreateDate) with a default of (getdate()); however, on the server where thi
s
table is built, it is not populating the CreateDate, and as a result I am
getting errors, has anyone ever seen an issue like this were the field
defaults aren't getting populated?Does the column allow nulls?
Is the insert statement inserting a blank string in that column, or
something else that shouldn't be inserted?
Are you receiving any errors?
can we see the insert script?
Simon Worth
Scott wrote:
> I have a strange (well I think its strange) where I have create a field
> (CreateDate) with a default of (getdate()); however, on the server where t
his
> table is built, it is not populating the CreateDate, and as a result I am
> getting errors, has anyone ever seen an issue like this were the field
> defaults aren't getting populated?|||"Simon Worth" wrote:
The field does NOT allow nuls, and I tested with a very simple script:
Insert into Codes
(Code,Description)
values ('0001','Test Code')
the error message that I received was that the field will not accept nulls
the actual verbage was "Cannot insert the value NULL into column
'CreateDate',table test_app.dbo.codes, column does not allow NULLs. Update
Fails."
I use this all the time, and I am sure alot of others as well, this is the
first time I have ever run into anything like this
> Does the column allow nulls?
> Is the insert statement inserting a blank string in that column, or
> something else that shouldn't be inserted?
> Are you receiving any errors?
> can we see the insert script?
> Simon Worth|||Are you certain that the default constraint is still on the column? Try
verifying existence with sp_help 'Codes'.
Hope this helps.
Dan Guzman
SQL Server MVP
"Scott" <Scott@.discussions.microsoft.com> wrote in message
news:B5F635A5-6379-41C9-A849-BC10B57865A7@.microsoft.com...
>
> "Simon Worth" wrote:
> The field does NOT allow nuls, and I tested with a very simple script:
> Insert into Codes
> (Code,Description)
> values ('0001','Test Code')
> the error message that I received was that the field will not accept nulls
> the actual verbage was "Cannot insert the value NULL into column
> 'CreateDate',table test_app.dbo.codes, column does not allow NULLs.
> Update
> Fails."
> I use this all the time, and I am sure alot of others as well, this is the
> first time I have ever run into anything like this
>
>
>
No comments:
Post a Comment