if exists(select * from sysobjects where type = 'U' and name = 'tablename')
drop table tablename;
查看所有的数据库
SELECT * FROM sysdatabases;
drop table tablename;
查看所有的数据库
SELECT * FROM sysdatabases;