SQL Server can't create sysname type colunmn

All we need is an easy explanation of the problem, so here it is.

I’m trying to create a new table based on an existing table.
In the existing one, there are two columns that are sysname data type.

But when I’m trying to create the new one with sysname, SSMS shows

Invalid data type

SQL Server can't create sysname type colunmn
But this doesn’t really make sense to me that if sysname is invalid, why it can be used in the old table?

My SQL Server version is Microsoft SQL Server 2019 (RTM-GDR) (KB5014356) – 15.0.2095.3 (X64)
SSMS version is 15.0.18390.0

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

The table designer is very limited and has a number of unresolved defects.

Most professionals choose to write T-SQL CREATE TABLE statements instead.

You will have noticed sysname is not available in the drop-down list of type names.

This is probably because it is a synonym (for nvarchar(128)) rather than a base type.

If you want to leave feedback for Microsoft about this, you can do so at https://aka.ms/sqlfeedback

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply