如果要在数据库中判断有没有某个表或存储过程,或触发器等等。都可以从数据库中的sysobjects表中查找。比如:要判断数据库pubs中有没有表authors,可以这样查询:
Select * form pubs.dbo.sysobjects where name='authors' and xtype='U'
如果要判断数据库pubs中有没有存储过程pr_sel,可以这样查询:
Select * form pubs.dbo.sysobje3cts where name='pr_sel' ane xtype='P'
Select * form pubs.dbo.sysobjects where name='authors' and xtype='U'
如果要判断数据库pubs中有没有存储过程pr_sel,可以这样查询:
Select * form pubs.dbo.sysobje3cts where name='pr_sel' ane xtype='P'