Msg 339, Level 16, State 1, Line 2
DEFAULT or NULL are not allowed as explicit identity values.
This error message appears, when one tries to explicitely INSERT a NULL marker into a column with the IDENTITY property. The same error is raised, when one tries to enter a value into such an IDENTITY column by using the DEFAULT VALUES syntax.
The T-SQL statement can be parsed, but causes the error at runtime.
Error of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. Neither NULL nor DEFAULT VALUES can be used to insert a value into a column with the IDENTITY property.
This error message was introduced with SQL Server 2005.
CREATE TABLE t
i1 INT IDENTITY
SET IDENTITY_INSERT t ON
INSERT INTO t(i1) SELECT NULL
DROP TABLE t
When you try to insert a value into a column with the IDENTITY property via SET IDENTITY_INSERT, this value should be of an integer type or the expression should evaluate to an integer type.