These is my example table definition:
CREATE TABLE [MyTable]
(
[ColumnName] [bit] NOT NULL
)
ALTER TABLE [MyTable] ADD DEFAULT ((0)) FOR [ColumnName]
I want to be able to pass a Null value to my stored procedure's @ColumnValue, something like:
@ColumnValue = null;
INSERT INTO [MyTable] ([ColumnName])
VALUES (@ColumnValue)
But I'm getting this error:
"Cannot insert the value NULL into column... INSERT fails with"
Why the DEFAULT constraints not working?