1.首先定义存储过程
USE [EBSDB]
GO
/****** Object: StoredProcedure [dbo].[SP_INV_MaterialReceiveReport2] Script Date: 10/17/2018 17:00:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SP_INV_MaterialReceiveReport2]
@db_center nvarchar(100),
@Receive_sn nvarchar(100)
AS
DECLARE @receivereport2 TABLE
(
DB_Center nvarchar(100),
Receiving_SN nvarchar(100),
Warehouse nvarchar(500) ,
Receive_Employee nvarchar(500) ,
Receive_Date datetime ,
PO_Code nvarchar(100),
Currency_Code nvarchar(100),
Total_Price decimal(30, 2),
Vendor nvarchar(500) ,
Material_Code nvarchar(100),
Material_Desc nvarchar(500),
Quantity1 decimal(30, 2),
Quantity2 decimal(30, 2),
Quantity3 decimal(30, 2),
Quantity4 decimal(30, 2),
UOM nvarchar(100) ,
Unit_Price decimal(30, 2),
Total_Price2 decimal(30, 2)
);
BEGIN
INSERT