如何在SQL数据库批量修改一列数据

如何在SQL数据库批量修改一列数据,第1张

 具体 *** 作步骤如下:

1 如果单元格中的数挨在一起,先选中一个单元格并按住鼠标右键,再拖动鼠标,即可选中所有数字。如单元格分散在各处,则先左手按住Ctrl件,右手逐一点击需选中的数即可。

2 在选中的最后一个单元格中,输入需修改的数据后,再同时按住Ctrl+enter件,这样,所有被选中的数字就批量修改了。

update creature_loot_template set ChanceOrQuestChance=100; commit; 出现对话框后输入sql, 然后找到有个执行的按钮,点下就行。(鼠标放在按钮上停顿一小会,看看按钮的功能,一般是一个向右的三角形)

我给你个我今天编写的程序吧

你看了自己照着改就可以了<%id=request("id")

xztype=trim(request("xztype"))

if id<>"" and xztype<>"" then

id=int(id)

%>

<table width="100%" border="1" align="center" bordercolor="cccccc">

<form action="bxfl2saveasp" method="post">

<tr align="center" bgcolor="#CCCCCC">

<td height="27">性别</td>

<td>年龄</td>

<td>保险金额</td>

<td>缴费期限<input type="hidden" name="idd" value="<%=id%>">

<input type="hidden" name="xztype" value="<%=xztype%>"></td><td>保费</td>

</tr>

<%sql="select from bftable where xztype='"&xztype&"' and idd="&id

rsopen sql,conn,1,3

if rsrecordcount=0 then

rsclose

responsewrite"<tr><td colspan=5><a href=bxflasp>请先添加保费后再修改保费</a></td></tr>"

responseend

else

soon=rsrecordcount

do while not rseof

i=i+1

if i=2 then

i=0

end if

if i=1 then

xx=""

end if

if i=0 then

xx="bgcolor=#cccccc"

end if

%>

<tr align="center" <%=xx%> >

<td height="27"><input name=id type="hidden" value="<%=rs("id")%>"><select name="sex" size="1" id="sex">

<option value="男" <%if trim(rs("sex"))="男" then

responsewrite " selected "

end if%>>男</option>

<option value="女" <%if trim(rs("sex"))="女" then

responsewrite " selected "

end if%>>女</option>

</select>

</td>

<td><input name="age" id="age" size="15" value="<%=trim(rs("age"))%>"></td>

<td><input name="bxmoney" id="bxmoney" size="15" value="<%=trim(rs("bxmoney"))%>"></td>

<td><input name="jfterm" id="jfterm" size="15" value="<%=trim(rs("jfterm"))%>"></td>

<td><input name="bf" size="15" value="<%=trim(rs("bf"))%>"></td>

</tr>

<%rsmovenext

loop

soon=i+1

if (soon mod 2)=0 then

xx="bgcolor=#cccccc"

else

xx=""

end if

end if

responsewrite"<tr "&xx&"><td colspan=5 height=27 align=center><input type=submit name=Submit value=确定 /></td></tr>"

%></form>

</table>

<%else

end if%>

上面是显示多条记录

下面是修改多条记录

<%

id=request("id")

idd=request("idd")

xztype=request("xztype")

sex=request("sex")

age=request("age")

bxmoney=request("bxmoney")

jfterm=request("jfterm")

bf=request("bf")

sex=split(sex,",")

for i = 0 to ubound(sex)

sex(i)=sex(i)

next

age=split(age,",")

for i = 0 to ubound(age)

age(i)=age(i)

next

bxmoney=split(bxmoney,",")

for i = 0 to ubound(bxmoney)

bxmoney(i)=bxmoney(i)

next

jfterm=split(jfterm,",")

for i = 0 to ubound(jfterm)

jfterm(i)=jfterm(i)

next

bf=split(bf,",")

for i = 0 to ubound(bf)

bf(i)=bf(i)

next

id=split(id,",")

for i = 0 to ubound(id)

id(i)=id(i)

next

for i=0 to ubound(bf)

if sex(i)<>"" or age(i)<>"" or bxmoney(i)<>"" or jfterm(i)<>"" or bf(i)<>"" then

sql="select from bftable where id="&trim(id(i))

rsopen sql,conn,1,3

rs("sex")=trim(sex(i))

rs("age")=trim(age(i))

rs("bxmoney")=trim(bxmoney(i))

rs("jfterm")=trim(jfterm(i))

rs("bf")=trim(bf(i))

rsupdate

rsclose

end if

next

%>

以上就是关于如何在SQL数据库批量修改一列数据全部的内容,包括:如何在SQL数据库批量修改一列数据、SQL数据库 如何快速修改一列所有的数据、ASP编程如何将同一数据库多条记录显示,并可同时修改(只需设置一键提交全部修改,不需逐条保存)等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/10154137.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-05
下一篇 2023-05-05

发表评论

登录后才能评论

评论列表(0条)

保存