Search This Blog

Sunday, December 9, 2012

OBJECT_ID SQL Server

SQL Server > Built-in FunctionsOBJECT_ID

OBJECT_ID returns the database object identification number of a schema-scoped object.

Example:

IF OBJECT_ID (N'dbo.tbl1', N'U') IS NOT NULL
  DROP TABLE dbo.tbl;
GO