Sqlserver: T-SQL data type = Corresponding = SQL-92 Synonym

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.