哪位兄弟帮忙看看sqlserver2000的存款过程
我不怎么会写存款过程,但存储过程有时确实快很多,因此我就把以前一些SQL语句改为存款过程来提高速度,我原语句如下:
sql="select layer,rootid,orders,announceid,topic,username,convert(char(10),dateandtime,120)'dateandtime1',convert(char(5),dateandtime,108)'dateandtime2',dateandtime,child,hits,length,isbest from "&totalusetable&" where boardid="& boardid &" and rootid='"&replace(rootid,"'","''")&"' and parentid<>'0' order by orders"
哪位兄弟帮我写成对应的存储过程,谢谢啦,我自己写成如下(错误的,写不来):
create proc Usp_gd_bbslist
@totalusetable nvarchar(30),
@boardid int(4),
@rootid nvarchar(30)
as
select
layer,rootid,orders,announceid,topic,username,convert(char(10),dateandtime,120)'dateandtime1',con
vert(char(5),dateandtime,108)'dateandtime2',dateandtime,child,hits,length,isbest from
@totalusetable where boardid=@boardid and rootid=@rootid and
parentid<>'0' order by orders
呵呵,一直提示,第 8 行: 'char' 附近有语法错误。也不懂是不是我这样写的,对了,请问存款过程多点没关系吧,应该不会降低数据库速度吧.
再附带一个ASP代码问题:
<% response.write "<table ><tr><td>"&test&"</td></tr></table>" %>这条语句执行速度是否比下面这条语句更低
<table ><tr><td><%=test%></td></tr></table>"
谢啦!