您现在的位置: 万盛学电脑网 >> 程序编程 >> 数据库 >> mssql数据库 >> 正文

sql判断且增加字段ADD

作者:佚名    责任编辑:admin    更新时间:2022-06-22

 sql 判断且增加字段

<%
Dim i,Rs,Sql,Table,Column,Bool
Table = "A"
Column = "B"
Bool = False
sql="Select * From ["&Table&"]"
Set Rs = Conn.ExeCute(Sql)
For Each i In Rs.Fields
'Response.Write(i.Name&"<br>")
If i.Name=Column Then
Bool = True
Exit For
End If
Next
If Bool Then
Response.Write("在《"&Table&"》表中,存在《"&Column&"》列!")
Else
Response.Write("在《"&Table&"》表中,不存在《"&Column&"》列!")
End If
%>