SQL Server 判断数据库是否存在,表是否存在

if DB_ID('testdb') is not null -- 如果这个数据库已经存在了

drop database testdb;

create database testdb;

 

 

if OBJECT_ID('dbo.user','u') is not null

drop table dbo.user;

create tablet dbo.user(......);

posted on 2015-06-28 07:25  蒋乐兴的技术随笔  阅读(499)  评论(0编辑  收藏  举报

导航