Table of ContentsPreviousNext

Ispirer
Please, note, that Ispirer SQLWays 6.0 is no longer supported and provided to clients.
You can try out automated conversion of databases and applications with Ispirer Toolkit for free. Download free trial.
Check out the relevant toolkit documentation.
Ispirer Sybase ASA to SQL Server Migration overview.


Ispirer SQLWays Database Migration Software

Conversion of Sybase ASA IFNULL to Microsoft SQL Server

The Sybase Adaptive Server Anyware IFNULL function returns one of two expressions, depending on whether a specified check expression is NULL or NOT NULL.

Microsoft SQL Server does not support IFNULL. The Microsoft SQL Server searched CASE expression can be used to implement the Sybase Adaptive Server Anyware IFNULL function.

SQLWays changes the Sybase Adaptive Server Anyware IFNULL function to the Microsoft SQL Server searched CASE expression that tests the first expression for NULL.

TABLE 69. Example of the conversion IFNULL with two expressions
Sybase Adaptive Server Anywhere
Microsoft SQL Server
create procedure asa_sp_ifnull (par int,
par2 int)
begin
declare res int;
SET res = IFNULL (par, par2);
end;
create procedure asa_sp_ifnull @par INT,@par2 INT
AS begin
declare @res INT
SET @res = CASE WHEN @par IS NULL THEN @par2 END
end

TABLE 70. Example of the conversion IFNULL with three expressions
Sybase Adaptive Server Anywhere
Microsoft SQL Server
create procedure asa_sp_ifnull (par int,
par2 int, par3 int)
begin
declare res int;
SET res = IFNULL (par, par2, par3);
end;
create procedure asa_sp_ifnull @par INT,@par2 INT, @par3 INT
AS begin
declare @res INT
SET @res = CASE WHEN @par IS NULL THEN @par2 ELSE @par3 END
end


Table of ContentsPreviousNext
Copyright 1999-2023 Ispirer Systems.
Ispirer and SQLWays are registered trademarks. All other product names may be trademarks of the respective companies.
All rights reserved.