📄 proc_mtl_where_used.sql
字号:
if object_id('dbo.Proc_MTL_Where_Used') is not null
drop procedure dbo.Proc_MTL_Where_Used
go
create procedure Proc_MTL_Where_Used
@hpn varchar(18) = null,
@alt_flag char(1) = null
as
begin
if(@alt_flag='Y')
begin
select a.cust_no as [Customer ID],d.legal_name as [Customer Name],
a.Parentno as [Model Number],c.description as [Model Name],b.mst_item as [HPN],
b.UoM,c.consign_flat as [Consigment Flag]
from merge_mrp.dbo.bas_bom_mainitem a, merge_mrp.dbo.bas_bom_subitem b ,baseitem c,ca_custmstr_hdr d
where a.parentno = b.parentno and a.parentno = c.itemno and a.cust_no = d.cust_num
and a.itemno =@hpn
end
else
begin
select a.cust_no as [Customer ID],d.legal_name as [Customer Name],
a.Parentno as [Model Number],b.description as [Model Name],a.Itemno as [HPN],
a.UoM,b.consign_flat as [Consigment Flag]
from merge_mrp.dbo.bas_bom_mainitem a, baseitem b,ca_custmstr_hdr d
where a.parentno = b.itemno and a.cust_no = d.cust_num
and a.itemno =@hpn
end
end
-- exec Proc_MTL_Where_Used '431503280000-CA001','Y'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -