if not object_id('sp_addtable','p') is null drop procedure sp_addtable go create procedure sp_addtable @tablename varchar(250) -- name of the new table as declare @strsql nvarchar(1000); set @strsql='create table ''' + @tablename + ''' (fldrecordid int identity(1,1) primary key, fldcreatedate datetime default (getdate()) null, fldlastupdatedate datetime default (getdate()) null, flduserupdated nvarchar(150) default (system_user) null,)'
if object_id(@tablename, 'u') is null sp_executesql @strsql go