if object_Id('DBALog') Is Not Null drop table DBALog go CREATE TABLE DBALog ( DBALogID int identity( 1, 1), entrydt datetime, cat char( 20), msg varchar( 500) ) GO grant select, insert, update, delete on DBALog to Developer go exec sp_Bindefault dfGetdate, 'DBALog.entrydt' BEGIN TRANSACTION ALTER TABLE dbo.DBALog ADD CONSTRAINT PK_DBALog PRIMARY KEY ( DBALogID ) ON [PRIMARY] GO COMMIT go if object_id( 'DBALog') Is Null select ' DBALog Not Created' else select ' DBALog Created' go