IF EXISTS(SELECT NAME FROM SYSOBJECTS WHERE NAME='库存调整_物料_PROC' AND TYPE='P')
DROP PROC 库存调整_物料_PROC
GO
create procedure 库存调整_物料_PROC
@item_to varchar (30),
@item_fr varchar (30)
as
CREATE TABLE [#库存调整]
(
[物料编码] [varchar] (30),
[计量单位] [varchar] (10),
[调整数量] [numeric](18, 6),
[仓库] [varchar] (10),
[货位编码] [varchar] (10),
[批号] [varchar] (15),
[原因码] [varchar] (10),
[处理日期] [datetime] )
insert into #库存调整(物料编码,计量单位,调整数量,仓库,货位编码,批号,原因码,处理日期)
select 物料编码,计量单位,调整数量,仓库,货位编码,批号,原因码,处理日期
from 库存调整 where 物料编码>=@item_to AND 物料编码 SELECT* FROM #库存调整