In SQL Server Management Studio when creating a New Table or adding columns to an existing table through the Table Designer, there are 3 columns presented:
- Column Name
- Data Type
- Allow Nulls
Allow Nulls always defaults to True (ticked), however, I am wondering if it is possible to configure SSMS to always default this to False (unticked)?
To a lesser extent I am also interested to know if it is possible to configure the editable default options within the Column Properties tab in the lower pane.
If you are fine with manipulating the registry key, here is an option to force the SSMS to always assign the value false to Allow Null property.
NOTE: Please be careful while altering registry keys.Type regedit in the Windows Start –> Run command to open the Registry Editor.
Navigate to
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell\DataProjectYou might need to change the SQL Server version accordingly. I am using SQL Server 2008 R2 Express and hence the version 100.Under the above mentioned registry path, look for the key name
SSVDefaultAllowNull.Right-click on the key and select Modify option. Change the value from 1 to
0. Default value is 1, which represents True.If you are already running SQL Server Management Studio, restart it. Thanks to @Andriy M for pointing out this step.
Hope that helps.