日期:2014-05-17  浏览次数:20549 次

SQLServer存储过程执行遭遇的问题
CREATE PROCEDURE [dbo].[up_Service_TSI_Part_Detail]

@service_report_no NVARCHAR(20),
@service_order_no  NVARCHAR(20),
@borrow_no         NVARCHAR(20),
@dealer_id        INT,
--@product_id    INT,
@model_id    INT,
@serial_no        NVARCHAR(20),
@part_no    NVARCHAR(20),
@part_no_new    NVARCHAR(20),
@create_date_start NVARCHAR(10),
@create_date_end   NVARCHAR(10),
@borrow_part_seq_id INT,
@userId    INT

AS
BEGIN

SET NOCOUNT ON;
    
    SELECT  ROW_NUMBER() OVER ( ORDER BY A.create_date DESC ) AS row_num ,
A.service_report_id ,
            A.service_report_no ,
            A.create_date ,
            B.service_order_id ,
            B.service_order_no ,
            C.borrow_part_seq_id ,
            C.borrow_no ,
--            B.product_id ,
--            B.product_name,
            B.model_id , 
            B.model_name ,
            B.serial_no ,
            B.dealer_id ,
            B.dealer_name,
            B.cust_name , 
            B.service_start_date ,
            B.service_end_date ,
            C.part_no ,
            C.part_name ,
            C.supplier_id , 
            C.steel_grade_no ,
            C.qty ,
            C.part_no_new ,
            C.part_name_new ,
            C.supplier_id_new ,
            C.steel_grade_no_new ,
            C.locale_dispose_qty ,
            C.return_qty ,
            C.scrap_value_qty ,
            C.return_place_name ,
  &