Ⅰ sql語句 判斷表數據是否存在另一個表中
工具/材料:Management Studio。
1、首先在桌面上,點擊「Management Studio」圖標。
Ⅱ sql語句怎樣判斷表是否存在
IF EXISTS(SELECT name FROM [sysobjects] WHERE name = '表名')
PRINT '該表存在'
ELSE
PRINT '該表不存在'。
Ⅲ VB中如何判斷 sql資料庫中的表是否已經存在
select name from sysobjects where xtype='u' and name='table1'
如果有記錄則存在,沒有記錄則不存在
<%
tablename="table1"
sql="select name from sysobjects where xtype='u' and name='"+tablename+"'"
rs.open sql,conn,0,1
if rs.eof then
response.write "不存在"
else
response.write "存在"
end if
%>
Ⅳ 在SQL中怎麼判斷資料庫里是否存在一張表
'select * from '+tableName+' where 1=0'