想将一段ASP代码用一个存储过程实现
我是想将以下ASP中的代码,转成SQL存储过程,前辈们帮帮忙,学习:
<%
strSql="select id,nsort1,filename from upload where id>1 and id<=1000 order by id"
set rs=conn.Execute(strSql)
if rs_1.eof and rs_1.bof then
else
do while not rs_1.eof
select case rs_1("nsort1")
case "article"
strSql="select 1 from article where charindex('"&rs_1("filename")&"',word)>0"
case "forum"
strSql="select 1 from bbs_data where charindex('"&rs_1("filename")&"',word)>0"
Case Else
strSql=""
end select
If strSql<>"" then
set rs=server.createobject("adodb.recordset")
rs.open strSql,conn,1,1
If rs.RecordCount>0 Then
strSql=""
Else
conn.execute("update upload set iid=0,types=0 where id="&rs_1("id"))
End If
rs.close:set rs=Nothing
End if
rs_1.movenext
loop
rs_1.close:set rs_1=Nothing
end if
%>
<%
strSql="select id,nsort1,filename from upload where id>1 and id<=1000 order by id"
set rs=conn.Execute(strSql)
if rs_1.eof and rs_1.bof then
else
do while not rs_1.eof
select case rs_1("nsort1")
case "article"
strSql="select 1 from article where charindex('"&rs_1("filename")&"',word)>0"
case "forum"
strSql="select 1 from bbs_data where charindex('"&rs_1("filename")&"',word)>0"
Case Else
strSql=""
end select
If strSql<>"" then
set rs=server.createobject("adodb.recordset")
rs.open strSql,conn,1,1
If rs.RecordCount>0 Then
strSql=""
Else
conn.execute("update upload set iid=0,types=0 where id="&rs_1("id"))
End If
rs.close:set rs=Nothing
End if
rs_1.movenext
loop
rs_1.close:set rs_1=Nothing
end if
%>
...全文
相关推荐
asp.net 用存储过程实现分页(附代码)
六、代码示例`sqlpager`文件可能包含了一个完整的示例项目,包括数据库脚本、存储过程定义以及ASP.NET页面的C#代码。通过查看和运行这个示例,你可以更直观地理解分页的实现过程。
ASP.NET 获取存储过程返回值的实现代码
ASP.NET 获取存储过程返回值的实现方法在ASP.NET开发中,与数据库交互是常见的操作,其中涉及到存储过程的使用。本资源主要介绍如何在ASP.NET中实现获取存储过程的返回值,特别是在执行
Asp Oracle存储过程返回结果集的代码
接下来是ASP代码的详细介绍:1. ASP页面设置了代码语言为VBScript,代码页为936,地区代码为2052。这些设置是为了确保ASP页面在处理中文字符时不会出现乱码。2.
ASP MSSQL存储过程的实现小例
在本例中,演示了如何在ASP和MSSQL(Microsoft SQL Server)环境下实现存储过程的创建与调用。
一个基于ASP.NET的数据库存储过程代码生成源程序
在这个特定的项目中,我们关注的是一个基于ASP.NET的数据库存储过程代码生成源程序。


