Making the Move from Sybase to SQL Server

Optimizer Hints

MSSQL Server allows for optimizer hints on SELECT, INSERT, UPDATE, and DELETE statements. Sybase allows optimizer hints only on SELECT statements.

The MSSQL Server vs. Sybase GUI approach:

Sybase

SQL Server

Use a text-based query analysis tool called SHOWPLAN Use Query Analyzer
Command to enable SHOWPLAN from within ISQL

SET SHOWPLAN ON
GO

Command to enable SHOWPLAN_ALL or SHOWPLAN_TEXT from query analyzer 

SET SHOWPLAN_ALL
GO

Temporary Table Names

Type of table name

Maximum length

SQL Server table name

128

SQL Server temporary table name

116

Sybase table name

30

Sybase temporary table name

13

Data Types

Data types

Sybase

SQL Server

char(n)

255

8000

varchar(n)

255

8000

nchar(n)

255

4000

nvarchar(n)

255

4000

binary

255

8000

varbinary

255

8000

Notes:

1) The bit data type in  MSSQLServer can be set to 0, 1, or NULL.

2) The bit data type in Sybase does not allow nulls.

Identity Columns

Sybase

SQL Server

Numeric(x,0)

Tinyint,smallint,int,decimal(x,0) or numeric(x,0)

Print Syntax

All PRINT statements that use substitution syntax must be changed to RAISERROR statements during the conversion process.

Conclusion

Converting a Sybase to SQL Server is a feat that can be accomplished, but there are a number of differences between the two products that must be addressed. Depending on the size of your application, this conversion could turn into a lengthy process. You don’t have to rewrite the whole application, but there are a fair amount of show stoppers. However, look at the bright side: I can’t think of an easier conversion between two major database packages than this one, and a successful conversion is highly probable because of the products many similarities. Happy migrating.

Published with the express written permission of the author. Copyright 2003.

]]>

Leave a comment

Your email address will not be published.