Data Type Synonym
Includes data type synonyms for compatibility with SQL-92.
Synonym |
Ing to System Data Type |
Binary varying |
Varbinary |
Char varying |
Varchar |
Character |
Char |
Character |
Char (1) |
Character (N) |
Char (N) |
Character varying (N) |
Varchar (N) |
Dec |
Decimal |
Double Precision |
Float |
Float[(N)]N= 1-7 |
Real |
Float[(N)]N= 8-15 |
Float |
Integer |
Int |
National Character (N) |
Nchar (N) |
National char (N) |
Nchar (N) |
National Character varying (N) |
Nvarchar (N) |
National char varying (N) |
Nvarchar (N) |
National text |
Ntext |
Rowversion |
Timestamp |
In Data Definition Language (DDL) statements such as create table, create procedure, or declare @ variable, data type synonyms can be used to replace the corresponding basic data type names. However, after an object is created, the synonym cannot be seen. When an object is created, the basic data type associated with the synonym is assigned to the object, and there is no record about the specified synonym in the statement for creating the object.
The basic data type will be assigned to all objects derived from the original object (such as result set columns or expressions. All subsequent metadata functions executed on the original object and any derived object will report Basic data types rather than synonyms. This includes metadata operations (suchSp_helpSystem stored procedures, information architecture views, and various data access API metadata operations for Data Types in other report tables or result set columns.
Data Type synonyms cannot be specified in graphical management utilities (such as SQL Server Enterprise Manager.
For example, you can create a specifiedNational Character varyingTable:
Create Table exampletable (prikey int primary key, varcharcol National Character varying (10 ))
ActuallyVarcharcolAssignedNvarchar (10)Data type, and all subsequent metadata functions report itNvarchar (10)Column. Metadata functions will never report themNational Character varying (10)Column.
1988-2004 Microsoft Corporation. All rights reserved.