首頁 >資料庫 >mysql教程 >sql判断且增加字段ADD

sql判断且增加字段ADD

WBOY
WBOY原創
2016-06-07 16:19:061559瀏覽

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.Namebr) If i.Name=Column Then Bool = True Exit For End If

 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&"
")
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
%>

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn