Sybase Adaptive Server SQL Functions

This section compares the functions provided by Sybase and SQL Server. Table A-3 provides a list of the functions supported by Sybase as well as how those functions differ on SQL Server. Only functions with differences between the two platforms have been listed.

Table A-3. Sybase Adaptive Server-supported functions

Sybase function

SQL Server function

Notes

To retrieve the application name on Sybase, use the following SQL statement:

select program_name

from master..sysprocesses

where spid = @@spid

APP_NAME( )

Returns application name for current session; set by application.

N/A

BINARY_CHECKSUM({* | expression [,...]})

Returns binary checksum for list of expressions or row of a table.

N/A

CAST(expression AS datatype)

Converts a valid SQL Server expression to the specified datatype. On Sybase Adaptive Server Enterprise, use the CONVERT function instead.

CHAR_LENGTH(expression)

N/A

Returns the number of characters in the expression. On SQL Server, the LEN function provides equivalent functionality.

N/A

CHECKSUM({* | expression [,...]})

Returns checksum value (computed over row values or expressions provided).

N/A

CHECKSUM_AGG([ALL | DISTINCT] expression)

Returns checksum of the values in group.

N/A

COALESCE(expression [,...])

Returns the first non-NULL argument from a list of arguments.

COMPARE(char_expression1, char_expression2 [, {collation_name | collation_ID}])

N/A

Returns the following ...

Get SQL in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.