coffeeak
coffeeak

Reputation: 3130

What are these fields in SQL Server 2008 R2?

I am finding these fields in SQL Server 2008 R2 but I have no idea what they are for and for example, what is the difference between bit and Flag:bit. I cannot find any documentation for it. I just found this link Data Types

Flag:bit
NameStyle:bit
Name:nvarchar
OrderNumber: nvarchar
Phone:nvarchar

Upvotes: 1

Views: 304

Answers (1)

sqluser
sqluser

Reputation: 5672

They are Alias Data Types and probably you found those names in AdventureWorks sample database provided by Microsoft

To get more info from Alias Data Types refer to this:

https://technet.microsoft.com/en-us/library/ms189283(v=sql.100).aspx

Alias types are based on the system data types in SQL Server. Alias types can be used when several tables must store the same type of data in a column and you have to make sure that these columns have identical data type, length, and nullability. For example, an alias type called postal_code could be created based on the char data type. Alias types without rules or an attached default definition are supported in table variables since SQL Server 2005. Alias types in table variables are not supported in SQL Server before SQL Server 2005.

To know the aliases MS is using on AdventureWorks refer to this one:

https://technet.microsoft.com/en-us/library/ms124807(v=sql.100).aspx

The following table lists alias data types, the Transact-SQL user-defined data types, and the tables and columns that use them

enter image description here

From technet.microsoft.com

Upvotes: 2

Related Questions