sql脚本创建表【如已经有表,先删除,后创建】

if  exists(select * from sysobjects where  type = 'U' and name = 'tablename')

drop table tablename;


查看所有的数据库

SELECT * FROM sysdatabases;

你可能感兴趣的:(SQL,Server)