Migrating Other Row-level Functions from Oracle to SQL Server

This table shows the equivalent Microsoft® SQL Server™ function for each Oracle function.

Function Oracle SQL Server
Return first nonnull expression DECODE COALESCE
Current sequence value CURRVAL N/A
Next sequence value NEXTVAL N/A
If exp1 = exp2, return null DECODE NULLIF
User’s login ID number UID SUSER_ID
User’s login name USER SUSER_NAME
User’s database ID number UID USER_ID
User’s database name USER USER_NAME
Current user USER USER
User environment (audit trail) USERENV N/A
Level in CONNECT BY clause LEVEL N/A

  


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