if exists (select name from sysobjects where name='采购单打印_PROC' and type='P')
drop PROC 采购单打印_PROC
go
create PROC 采购单打印_PROC
@po int
AS
CREATE TABLE [#采购订单明细表] (
[采购单号] [int] ,
[供应商编码] [varchar] (10) ,
[行] [int] ,
[物料编码] [varchar] (30) ,
[计量单位] [varchar] (10) ,
[订购数量] [numeric](18, 6) ,
[订购日期] [datetime] ,
[到期日期] [datetime] )
INSERT INTO #采购订单明细表(采购单号,供应商编码,行,物料编码,计量单位,订购数量,订购日期,到期日期)
SELECT 采购单号,供应商编码,行,物料编码,计量单位,订购数量,订购日期,到期日期 FROM 采购订单明细表
WHERE 采购单号=@PO
SELECT *FROM #采购订单明细表
-- EXEC 采购单打印_PROC 1