判断是否存在数据 if exists( select * from ...
判断要创建的表名是否存在ifexists select fromdbo.sysobjectswhereid object id N dbo . 表名 andOBJECTPROPERTY id,N IsUserTable 删除表droptable dbo . 表名 GO 判断要创建临时表是否存在IfObject Id Tempdb.dbo. Test IsNotNullBeginprint 存在 ...
2018-12-11 20:41 0 989 推荐指数:
判断是否存在数据 if exists( select * from ...
判断数据库是否存在if exists (select * from sys.databases where name = '数据库名')drop database [数据库名]判断表是否存在if exists (select * from sysobjects where id ...
判断数据库是否存在 if exists (select * from sys.databases where name = '数据库名') --drop database [数据库名] 判断表是否存在 if exists (select * from sysobjects where ...
库是否存在 if exists(select * from master..sysdatabases where name=N'库名') print 'exists' else print 'not exists' --------------- -- 判断要创建的表名是否 ...
1、判断表是否存在 select * from sysobjects where id = object_id(表名) and OBJECTPROPERTY(id, N'IsUserTable') = 1 2、判断视图是否存在 select table_name from ...
库是否存在 if exists(select * from master..sysdatabases where name=N'库名') print 'exists'elseprint 'not exists'--------------- -- 判断要创建的表名是否存在 if exists ...
下面为您介绍sql下用了判断各种资源是否存在的代码,需要的朋友可以参考下,希望对您学习sql的函数及数据库能够有所帮助。库是否存在if exists(select * from master..sysdatabases where name=N'库名')print 'exists ...