A.1 Sybase Adaptive Server Datatypes

     

Table A-1 compares the datatypes supported by Sybase Adaptive Server to those supported by Microsoft SQL Server. While there is significant overlap in the types offered , a few types differ in meaning or are missing on one of the platforms. Where differences in the types exist, they'll be listed in the table. Types that are not listed within the table should be considered identical on both platforms.

Table A-1. Sybase Adaptive Server datatypes

Sybase adaptive server datatype

Microsoft SQL Server datatype

Notes

N/A

BIGINT

Usage of decimal(19,0) as an equivalent to BIGINT will allow storage of values within the same range.

BINARY

BINARY

Describes a fixed-length binary value up to 255 bytes in size . In contrast, Microsoft SQL Server can store 8,000 bytes.

CHAR(N )

CHAR(N)

Holds fixed-length character data up to the database's page size in length.

DATETIME

DATETIME

Holds date and time data within the range of 1753-01-01 00:00:00 through 9999-12-31 23:59:59. The DATETIME type can store milliseconds with a granularity of 1/300 second.

NCHAR(N)

N/A

Holds fixed-length character strings in the national character set up to the database's page size in length. In contrast, Microsoft SQL Server's NCHAR datatype stores Unicode character strings.

N/A

NTEXT

Holds Unicode text passages up to 1,073,741,823 characters in length.

NVARACHAR(N)

N/A

Holds variable-length character strings in the national character set up to the database's page size in length. In contrast, Microsoft SQL Server's NVARACHAR datatype stores Unicode character strings.

TIMESTAMP

ROWVERSION

A unique number within a database that is updated whenever a row is updated.

SMALLDATETIME

SMALLDATETIME

Holds date and time data within the range of 1900-01-01 00:00 through 2079-12-31 23:59. Unlike Microsoft SQL Server, Sybase cannot hold dates with second resolution in a SMALLDATETIME .

N/A

SQL_VARIANT

Sybase has no weakly typed storage type like SQL Server's SQL_VARIANT .

UNICHAR

NCHAR(N)

Stores fixed-length, Unicode character strings up to the database's page size in length.

N/A

UNIQUEIDENTIFIER

Represents a value that is unique across all databases and all servers.

UNIVARCHAR

NCHAR(N)

Stores variable-length, Unicode character strings up to the database's page size in length.

VARBINARY(N)

VARBINARY(N)

Describes a variable-length binary value up to 255 bytes in size. In contrast, Microsoft SQL Server can store up to 8,000 bytes.

VARCHAR(N)

VARCHAR(N)

Holds fixed-length character data up to the database's page size in length.


The primary differences between the types offered by SQL Server and Sybase are the storage sizes, precision, and default meaning of the NCHAR type. When converting data from one platform to the other, it is important to observe these subtle differences to avoid data truncation or corruption.



SQL in a Nutshell
SQL in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596518846
EAN: 2147483647
Year: 2003
Pages: 78

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net