I have a sql table that has the column CreatedDate.
It’s setup in the database with:
Default Value of Binding (getdate())
ALTER TABLE [dbo].[Person] ADD CONSTRAINT [DF__Person__Creat__6XXXXXXX] DEFAULT (getdate()) FOR [CreatedDate]
GO
The insert works when I send default through for that column but if I send NULL I get.
Cannot insert the value NULL into column ‘CreatedDate’ column does not allow nulls. INSERT fails.
Is there any way to get this to work so it will set the current date when null is sent through?
because you have set a contraint on that column and you have specified that a default value on that column is the current date
GetDate()