When generating Insert code use defaults
If you create a table with a BIT column not nullable with a default value, and then you type insert, the autocomplete gives you null for the bit column. Example below. (I haven't looked at what happens with other data types/defaults.)
CREATE TABLE dbo.MyTable
(
Flag BIT NOT NULL CONSTRAINT DFMyTableFlag DEFAULT (0)
)
GO
INSERT INTO dbo.MyTable
(
Flag
)
VALUES
(NULL -- Flag - bit
)
![](https://secure.gravatar.com/avatar/a445d3b3cea90f99e524662c39f2c195?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
Hi,
This feature has actually just been added to SQL Prompt, and will be included in the next release (10.6.11).
Thanks,
Owen
-
Michael commented
I'm running 10.6.11.19980 and this issue has definitely not been fixed. Other data types like varchar and int do not bring through the default values either.