Saturday 16 January 2010

Syntax for checking objects existence - SQL

SET NOCOUNT ON;
USE
database;
GO
IF OBJECT_ID('dbo.table) IS NOT NULL
DROP TABLE dbo.table
GO
CREATE TABLE .....

No comments: