加工入库单
来源:互联网 发布:个人自动发卡源码带wap 编辑:程序博客网 时间:2024/04/27 16:13
exec P_Paged 'id',' select * from ','T_billprint','BatchNo desc',20,1,'kind =''加工入库单'''
------------------------------------
--
--用途:分页存储过程
--时间:2005年7月26日
--
-------------------------------------
create PROCEDURE P_Paged
@firstField varchar(100), --表的唯一字段
@selectfield varchar(800), --其他字段,与@firstField无关,包含Select/From
@tableName varchar(100), -- 字段及表名
@orderfield varchar(200), -- 排序字段,包含desc,asc
@PageSize int = 20, -- 页尺寸
@PageIndex int = 1, -- 页码
@strWhere varchar(1000) = '1=1' -- 查询条件 (注意: 不要加 where)
AS
BEGIN
DECLARE @PageLowerBound int
DECLARE @PageUpperBound int
declare @sql varchar (500)
declare @sql2 varchar (1000)
/*
DECLARE @RowsToReturn int
-- First set the rowcount
SET @RowsToReturn = @PageSize * (@PageIndex + 1)
SET ROWCOUNT @RowsToReturn
*/
-- Set the page bounds
SET @PageLowerBound = @PageSize * @PageIndex
SET @PageUpperBound = @PageLowerBound + @PageSize + 1
-- Create a temp table to store the select results
CREATE TABLE #PageIndex
(
IndexId int IDENTITY (1, 1) NOT NULL,
TableID int
)
-- Insert into the temp table
set @sql = 'INSERT INTO #PageIndex (TableID) SELECT ' + @firstField + ' FROM ' + @tableName + ' Where ' + @strWhere + ' order by ' + @orderfield
exec(@sql)
-- Return total count
SELECT COUNT(*) FROM #PageIndex
-- Return paged results
set @sql2 = @selectfield + @tableName + ' as t1 ,#PageIndex as tmp Where '
+ 't1.' + @firstfield + ' = tmp.TableID AND ' + ' tmp.IndexID > ' + str(@PageLowerBound) + ' AND tmp.IndexID < ' + str(@PageUpperBound)
exec(@sql2)
END
GO
CREATE TABLE
(
IndexId int IDENTITY (1, 1) NOT NULL,
TableID int
)
INSERT INTO #PageIndex (TableID)
SELECT * FROM #PageIndex --T_billprint Where 1=1 order by id desc --' + @strWhere + ' order by ' + @orderfield
- 加工入库单
- 炼钢厂入库单
- 客户退货入库单
- 入库单打印
- WIP 完工入库单
- 采购单入库操作
- 采购入库单的问题。
- 加工
- datatable应用---创建添加保存入库单
- 获取过去几天的入库单
- odoo采购单入库代码剖析
- 入库
- 其它入库单与存货核算的入库单出现问题,前者无效,后者存在
- AS3 单例模式的加工,效果: 加强判断
- 大话ERP之生产入库单 ERP的背后功臣
- 更改外购入库单的不一致辞价格
- MFC Grid control 2.26打印出/入库单的实现
- 产成品入库单的单价是手工填写吗?
- 回家了
- 我的程序语录
- 由窗句柄获得对应可执行文件名
- 用INDY判断网页是否存在
- 技术&管理&做人&行业 程序员的成长(转载)
- 加工入库单
- SVIZ - 矢量图形平台介绍
- 设计迷踪:给JAVA设计开发新手的一些建议和意见(一)
- 设计迷踪:给JAVA设计开发新手的一些建议和意见(二)
- 设计迷踪:给JAVA设计开发新手的一些建议和意见(三)
- 设计迷踪:给JAVA设计开发新手的一些建议和意见(四)
- ASP.NET/VB.NET中凌晨0点的表示
- 软件12法则
- 在学术的道路上一路狂奔