sql批量修改

来源:百度知道 编辑:UC知道 时间:2024/05/22 09:55:14
表格:goods
code name isltd
商品代码|商品名称|状态
1010 A 0
1011 B 5
1012 C 3
…… …… ……
…… …… ……

我要实现的是将个别的商品(例如:1010和1012)的状态改成“10”
请问怎么一次通过sql语句实现?

<%
set rs=server.createobject("ADODB.Recordset")
sql="select * from goods"
rs.open sql,conn,3,3
for i=1 to rs.recordcount
if rs("code")=1010 or rs("code")=1012 then
sql1="update goods set isltd=10 where code=1010 or code=1012"
conn.execute(sql1)
end if
next
%>

sql = "update .......;update......;update.....";
多句连起来,一起提交