Migrating Control-of-Flow Keywords from Oracle to SQL Server

These are the keywords supported by Oracle and Microsoft® SQL Server™.

Statement Oracle SQL Server
Declare variables DECLARE DECLARE
Statement block BEGIN...END; BEGIN...END
Conditional processing IF...THEN,
ELSIF...THEN,
ELSE
ENDIF;
IF...[BEGIN...END]
ELSE [BEGIN...END]
CASE expression
Unconditional exit RETURN RETURN
Wait for a specified interval N/A WAITFOR
Loop control WHILE...END LOOP;
LABEL...GOTO LABEL;
FOR...END LOOP;
LOOP...END LOOP;
WHILE...
LABEL...GOTO LABEL
Program comments /* ... */, -- /* ... */, --
Print output DBMS_OUTPUT.PUT_LINE PRINT
Raise program error RAISE_APPLICATION_ERROR RAISERROR
Execute program EXECUTE EXECUTE
Statement terminator Semicolon (;) N/A

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.