工具/材料:Management Studio。
1、首先在桌面上,点击“Management Studio”图标。
3、然后在该界面中,点击左上角“新建查询”选项。
4、之后在该界面中,输入判断表是否存在,如存在就删除的SQL语句“IF EXISTS (select * from information_schema.tables where table_name ='test') beginPRINT '存在'drop table testendELSEPRINT '不存在'”。
5、然后在该界面中,点击上方左侧的“执行”按钮。
5、然后在该界面中,判断表存在。
6、最后在该界面中,查看表test,表test被删除。
rem x=0 表示不存在,x=1 表示存在strConn="DBQ="+server.mappath("zw.mdb")+"DefaultDir=DRIVER={Microsoft Access Driver (*.mdb)}"
set objConn=server.createobject("Adodb.connection")
objConn.open strConn
set rsSchema=objConn.openSchema(20)
rsSchema.movefirst
tablename="gd111"
x=0
Do Until rsSchema.EOF
if rsSchema("TABLE_TYPE")="TABLE" then
if rsSchema("TABLE_NAME")=tablename then
x=1
exit do
end if
end if
rsSchema.movenext
Loop
if x=0 then response.write"没有找到!!!立即删除"
if x=1 then
response.write"找到了"
conn.execute("drop table recycletest")
end if
set objConn=nothing
%>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)