if (select count(*) from sysobjects where name='A' )=1 print 'exists A' else print ' not exists A'
select name from sysobjects where xtype='u' sp_tables select * from INFORMATION_SCHEMA.TABLES select * from sysobjects where xtype='U' and status>0这4个都可以,自己改吧!
if exists(select name from sysobjects where name='A' and xtype='U') ........if exists(select name from sysobjects where id=Object_id('A') and OBJECTPROPERTY(id,N'isUserTable)=1) ........if exists(select name from master.dbo.sysdatabases where name = 'A') ........if Object_id('A') is not null ........
print 'exists A'
else
print ' not exists A'
sp_tables
select * from INFORMATION_SCHEMA.TABLES
select * from sysobjects where xtype='U' and status>0这4个都可以,自己改吧!
........if exists(select name from sysobjects where id=Object_id('A') and OBJECTPROPERTY(id,N'isUserTable)=1)
........if exists(select name from master.dbo.sysdatabases where name = 'A')
........if Object_id('A') is not null
........