OBJECT_ID
Description
This function returns the database object identification number of a schema-scoped object.(OBJECT_ID in Transact-SQL).
OBJECT_ID ( '[ database_name . [ schema_name ] . | schema_name . ]
object_name' [ ,'object_type' ] )
Sample Source Patterns
1. Default transformation
IF OBJECT_ID_UDF('DATABASE2.DBO.TABLE1') is not null) THEN
DROP TABLE IF EXISTS TABLE1;
END IF;
2. Unknown database
Code:
IF OBJECT_ID_UDF('DATABASE1.DBO.TABLE1') is not null) THEN
DROP TABLE IF EXISTS TABLE1;
END IF;
3. Different object names
Code:
IF OBJECT_ID_UDF('DATABASE1.DBO.TABLE2') is not null) THEN
DROP TABLE IF EXISTS TABLE1;
END IF;
Known issues
1. OBJECT_ID_UDF function has different behavior in certain cases
OBJECT_ID returns the object identification number but the OBJECT_ID_UDF returns a boolean value, so that they are equivalent only when OBJECT_ID is used with not null condition.
Related EWIs
SSC-EWI-0001: Unrecognized token on the line of the source code.
SSC-FDM-0007: Element with missing dependencies
Last updated