Search code examples
t-sqldatabase-designssmssqldatatypes

SSMS 15 Default Data Type in Designer


Is there any way to force SSMS (SQL Server Management Studio) 15 to create a column in the designer with the default data type that I want, in this case nvarchar(100) instead of nchar(10).

Interestingly, there are a few ideas about this on the web, involving changing the registry, however when I do this and restart SSMS the registry just reverts back to nchar(10).

This makes me wonder if there is now a setting or an option inside SSMS to achieve this? I have expanded every tree in the options and I cannot find anything there.

I would actually consider a plug-in at this point.


Solution

  • I decided to post an answer because the behaviour of SSMS is a bit more complicated.

    Firstly, for version 18.5.1 (latest, the version I am using) the registry path is:

    HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\18.0_IsoShell\DataProject.

    It's not difficult to find the path and the keys, as others have already stated.

    However the problem was not finding the keys, it was that SSMS was reverting the registry keys back when I was restarting the editor after making the change. Since the editor is saving those keys on closing, and I was making changes after failing to succeed (with the editor still open), the keys were always being overwritten.

    The trick is to close SSMS before changing the registry, something I wasn't doing previously. Every article on this subject states having to 'restart the editor after making the changes', whereas the correct advice would be to 'close the editor before making the changes'.

    Hopefully someone else having the same problem will find this useful.