抓老鼠的铁笼:判断数据库中某个表是否存在的asp代码
来源:百度文库 编辑:高考问答 时间:2024/05/03 01:08:25
select count(*) as counts from 数据库名.dbo.sysobjects where name='表名' and type='u'
比如你要查看 mydb数据库下,是否存在mytable表语句就是
select count(*) as counts from mydb.dbo.sysobjects where name='mytable' and type='u'
在ASP里得到rs("counts")的值,如果大于0,则mytable表就存在。