WimP
2015-05-29T00:49:00Z
Why is SQL server throwing this error: Cannot insert the value NULL into column 'id'?
Administrator
2015-05-29T00:54:00Z
“Cannot insert the value NULL” into column X, means column must contain a value (cannot be empty).

Assuming Id column is your primary key, you must provide a SQL Statement to generate new value for insert.

Please check you Primary key setting Assign Table -> Mandatory Keys.

Possible statements per datatype:
Guid:
select newid()
int auto identity(also Auto Increment, AutoNumber etc.):
select @@IDENTITY , Identity column must be set to Yes!
int (NO Auto Increment):
select ISNULL(max(YOUR_COLUMN_NAME)+1,1) from YOUR_TABLE_NAME
Similar Topics