惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
IT之家
IT之家
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
B
Blog RSS Feed
H
Help Net Security
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
L
LangChain Blog
Vercel News
Vercel News

博客园 - Arthur_wuancheng(大步牛)

练手之作:易元威客任务发布系统(2) 练手之作:易元威客任务发布系统(1) 人生一世 草木一秋 如何进行高效的项目管理?(转) 项目管理的一点总结 极限编程法一点思考 WEB Service 下实现大数据量的传输 (转) 项目经验(转) Atlas 学习笔记: ajax 改进 by Atlas ajax for .net in vs2003 like gmail ^_^ C# 2.0 New Feature(1) WebService Enhancements 2.0 Learning Note ref type & out type Duwamish架构分析篇 (转) 程序编码应保持良好的规范(C#)(转) 也谈代码规范 (转) 如何用正确的方法来写出质量好的软件的75条体会 [转] How to Write to Database by EnterPriseLibrary2005 Logging Application Block(项目心得) 自己正在做电信的互联星空项目,里面用到的xml
存储过程分页,以及动态sql(Sql server)
Arthur_wuancheng(大步牛) · 2005-12-14 · via 博客园 - Arthur_wuancheng(大步牛)

/*
CopyRight  2005 www.zte.com.cn  All rights reserved.
系统名称  :互联星空
子系统名称:资源管理子系统
描述      :检索SP订购关系列表
作者      :吴岸城
创建日期  :2005-12-13
*/

alter procedure dbo.Up_Res_SearchSPOrderInfo
(
 @SPID varchar(60),
 @ServiceID varchar(60),
 @UserID varchar(60), 
 @SubscriptionDate varchar(60),
 @SubscriptionDateEnd varchar(60),
 @Status varchar(60) ,
 @CountOnePage int,
 @Pages int
)
as
declare @SqlString nvarchar(1000)

set  @SqlString =' SELECT TOP '+@CountOnePage+' a.TxID, a.UserID, a.ChargeID, a.SPID, a.ServiceID, a.SubscriptionDate,
 a.BeginDate, a.EndDate, a.Status, b.SPName, b.ServiceName
 FROM   spms_ServiceSubscription a LEFT OUTER JOIN
   vwResourceSPService b ON a.ServiceID = b.ServiceID
 
 WHERE   (b.ServiceID>(SELECT MAX(b.ServiceID)FROM
   (SELECT TOP '+@Pages+' b.ServiceID FROM spms_ServiceSubscription a LEFT OUTER JOIN
     vwResourceSPService b ON a.ServiceID = b.ServiceID ORDER BY b.ServiceID)
  AST)) '

if (@SPID is not null and @SPID<>'')
set @SqlString=@SqlString+' and a.SPID = @SPID '

if (@ServiceID is not null and @ServiceID<>'')
set @SqlString=@SqlString +' and a.ServiceID = @ServiceID '

if (@UserID is not null and @UserID<>'')
set @SqlString=@SqlString +' and a.UserID = @UserID '

if (@Status is not null and @Status<>-1)
set @SqlString=@SqlString +' and a.Status = @Status '

if (@SubscriptionDate is not null) and (@SubscriptionDate <> '')
 set @SqlString = @SqlString + ' and a.SubscriptionDate >= ''' + @SubscriptionDate + ' 00:00:00'''
  
if (@SubscriptionDateEnd is not null) and (@SubscriptionDateEnd <> '')
 set @SqlString = @SqlString + ' and a.SubscriptionDate <= ''' + @SubscriptionDateEnd + ' 23:59:59'''

EXEC sp_executesql @SqlString
RETURN

posted on 2005-12-14 16:53  Arthur_wuancheng(大步牛)  阅读(290)  评论()    收藏  举报