You are here
Home > How To > SQL Server Management Studio – Changing Default Data Type In Table Designer

SQL Server Management Studio – Changing Default Data Type In Table Designer

SQL Server Management Studio

If there is one thing that I always had a pet peeve with, was the table designer column data type default in SQL Server Management Studio. You have no option (that I am aware of) to change the default column data type when creating a new data table in table designer. SQL Server Management Studio decides that using ‘nchar’ is the way to go.

Looking for something else? Try these links instead:

Well if you want to make your columns another data type, you need to manually select the default value and change it to the data type you want. I wanted to find a way to change that default. Turns out that there is an easy way to accomplish this.

SQL Server Management Studio

If you look at the screenshot below, you will see what I am talking about.

SQL Server Management Studio

I wanted a way to change this behaviour. You can do this in the registry. Now seeing as all the sites I visit that involve some sort of registry change always have a disclaimer, I think that I need one too. If you screw up your registry, your PC will become self aware and try and strangle you with its power chord. Thereafter it will explode and die a digital death never to work again.

Modifying the Registry

Ok, fire up the registry editor and head on over to HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell\DataProject. Please note that I am running SQL Server Management Studio 2008 R2 on this machine. If you have another version, the registry path might be a little different for you. On SSMS 2017 the Registry path is: HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\14.0\DataProject. Pro tip: You can always just search the registry for the keyword below.

SQL Server Management Studio

Locate the keyword SSVDefaultColumnType and change the value to the data type you prefer. I changed mine to nvarchar. Exit the registry editor and restart SQL Server Management Studio.

SQL Server Management Studio

This time, when you create a new table and add a new column, your data type defaults to the desired data type. Personally, I don’t like fooling around in the registry, but if it gets the job done, then I’m all for it. If anyone has another solution to this, some other setting in the SQL Server options please let me know in the comments below.

Download SQL Server 2008 Management Studio Express, SQL Server Central

Dirk Strauss
Dirk is a Software Developer from South Africa. He loves all things Technology and is slightly addicted to Jimi Hendrix. Apart from writing code, he also enjoys authoring books and articles. "I love sharing knowledge and connecting with people from around the world. It's the diversity that makes life so beautiful." Dirk feels very strongly that pizza is simply not complete without Tabasco, that you can never have too much garlic, and that cooking the perfect steak is an art he has almost mastered.
https://dirkstrauss.com

Similar Articles

Top