if exists (select * from dbo.sysobjects where id = object_id(N'dbo.mytable') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table dbo.mytable