sethreno / schemazen

Script and create SQL Server objects quickly
MIT License
333 stars 140 forks source link

'bit' type columns with NULL allowed are exported with "bit NULL DEFAULT ((0))" #177

Closed jensb closed 4 years ago

jensb commented 4 years ago

I have this table:

CREATE TABLE foo ( ... foobar [bit] NULL, ... )

but when I export this with SchemaZen I get

CREATE TABLE foo ( ... foobar [bit] NULL DEFAULT ((0)), ... )

which of course destroys all NULL values, thus corrupting data during the transition.

jensb commented 4 years ago

This seems to be a bug (or something) in the database. I get the same result when connecting to it with MSSMS 2014 - but not with MSSMS 2017. Weird. But (I guess) schemazen is not the problem.