您当前的位置:天天ASP学习数据库MSSQL → 文章内容

mssql存储过程创建

作者:本站  来源:本站原创  发布时间:2019-07-06 11:24:57
create proc [dbo].[ttasp_cheguan](@PageNow int)
as
begin    
   declare @TopNum int
	declare @str varchar(4000)
	set @TopNum = 50*(@PageNow-1)
	set @str = 'Select top 76 Topic,ip,link,AnnounceID,UserName,DateAndTime,Expression,Orders,Extract1,Top1,DateandTime,infosort,body From qiuzhu where  yesno=''yes'' and top1 is null and AnnounceID not in(Select top '+ str(@TopNum) +' AnnounceID From qiuzhu where  yesno=''yes'' and top1 is null Order By top1 Desc,ReplyTime Desc,DateAndTime Desc) Order By top1 Desc,ReplyTime Desc,DateAndTime Desc'
	exec(@str)
end
 
文章评论 (评论内容只代表网友观点,与本站立场无关!)