none
has too many arguments specified

    Question

  • Msg 8144, Level 16, State 2, Procedure sp_Budget_CashFlow_Worksheet_Update, Line 0
    Procedure or function sp_Budget_CashFlow_Worksheet_Update has too many arguments specified.

    Checked in Excel that number of parameters are correct, but error has many arguments

    declare @Result nvarchar(4000)
    declare @Budget_CashFlow_Worksheet_ID int
    exec sp_Budget_CashFlow_Worksheet_Update 56, -- @Budget_CashFlow_Header_ID
    '00000B3H', -- @Budget_CashFlow_Worksheet_Name
    '1/3/2013', -- @YrEnd_Date
    'Unsecured', -- @Budget_Project_On_Hand_Status
    'Template-Project (HK & Macau).xls', -- @Upload_FileName
    'N/A', -- @Budget_Main_Contractor_ProjectNo
    'N/A', --@Budget_Main_Contractor
    'PYBL', -- @Budget_Company_Name
    'Office Development at ABC St', -- @Budget_Project_Name
    '00000B3H', -- @Budget_Project_No
    'Hutchison', -- @Budget_Customer_Name
    'Private', -- @Budget_Customer_Type
    1.00, -- @Budget_Hit_Rate
    'Building Construction', -- @Budget_Nature_Of_Works
    1.0, -- @Budget_Percentage_Shared
    '15/9/2011', -- @Budget_Estimated_Completed_Date
    Null, --@Budget_Actual_Completed_Date
    '2/8/2011', -- @Budget_Date_of_award
    1,460,000.00, -- @Budget_Original_Contract_Sum
    1,413,271.00,--@Budget_Estimated_Final_Contract_Sum
    1,407,430.95,--@Budget_Estimated_Final_Costs
    5,840.05,--@Budget_Estimated_Final_Margin
    '1/11/2011',--@CumTo_ForPeriod_YrMth
    '1/12/2011',--@ForPeriodC9_YrMth
    '1/1/2012',--@ForPeriodC10_YrMth
    '1/2/2012',--@ForPeriodC11_YrMth
    '1/3/2012',--@ForPeriodC12_YrMth
    '1/4/2012',--@ForPeriod1_YrMth
    '1/5/2012',--@ForPeriod2_YrMth
    '1/6/2012',--@ForPeriod3_YrMth
    '1/7/2012',--@ForPeriod4_YrMth
    '1/8/2012',--@ForPeriod5_YrMth
    '1/9/2012',--@ForPeriod6_YrMth
    '1/10/2012',--@ForPeriod7_YrMth
    '1/11/2012',--@ForPeriod8_YrMth
    '1/12/2012',--@ForPeriod9_YrMth
    '1/1/2013',--@ForPeriod10_YrMth
    '1/2/2013',--@ForPeriod11_YrMth
    '1/3/2013',--@ForPeriod12_YrMth
    '1/4/2013',--@ForPeriod13_YrMth
    '1/5/2013',--@ForPeriod14_YrMth
    '1/6/2013',--@ForPeriod15_YrMth
    '1/7/2013',--@ForPeriod16_YrMth
    '1/8/2013',--@ForPeriod17_YrMth
    '1/9/2013',--@ForPeriod18_YrMth
    '1/10/2013',--@ForPeriod19_YrMth
    '1/11/2013',--@ForPeriod20_YrMth
    '1/12/2013',--@ForPeriod21_YrMth
    '1/1/2014',--@ForPeriod22_YrMth
    '1/2/2014',--@ForPeriod23_YrMth
    '1/3/2014',--@ForPeriod24_YrMth
    'After Mar-14', -- @ForPeriod_After_YrMth
    '4 Mths to Mar-12', -- @Total_Budget_Four_Mths_to_1
    'Cum to Mar-12', -- @Cum_Four_Mths_to_1
    '12 Mths to Mar-13', -- @Total_Twelve_Mths_to_1
    'Cum to Mar-13',-- @Cum_Twelve_Mths_to_1
    '12 Mths to Mar-14',-- @Total_Twelve_Mths_to_2
    'Total', -- @Total_All
    @Budget_CashFlow_Worksheet_ID,--0, -- @Budget_CashFlow_Worksheet_ID
    @Result

    exec [dbo].[sp_Budget_CashFlow_Worksheet_Update]	Stored procedure	
    56, -- @Budget_CashFlow_Header_ID	@Budget_CashFlow_Worksheet_ID int output,	
    '00000B3H', -- @Budget_CashFlow_Worksheet_Name	@Budget_CashFlow_Header_ID	int
    '1/3/2013', -- @YrEnd_Date	@Budget_CashFlow_Worksheet_Name	nvarchar(100)
    'Unsecured', -- @Budget_Project_On_Hand_Status	@YrEnd_Date	datetime
    'Template-Project (HK & Macau).xls', -- @Upload_FileName	@Budget_Project_On_Hand_Status	nvarchar(50)
    'N/A', -- @Budget_Main_Contractor_ProjectNo	@Upload_FileName nvarchar(150),	
    'N/A', --@Budget_Main_Contractor	@Budget_Main_Contractor_ProjectNo	nvarchar(100)
    'PYBL', -- @Budget_Company_Name	@Budget_Main_Contractor	nvarchar(100)
    'Office Development at ABC St', -- @Budget_Project_Name	@Budget_Company_Name	nvarchar(200)
    '00000B3H', -- @Budget_Project_No	@Budget_Project_Name	nvarchar(200)
    'Hutchison', -- @Budget_Customer_Name	@Budget_Project_No 	nvarchar(30)
    'Private', -- @Budget_Customer_Type	@Budget_Customer_Name	nvarchar(200)
    1.00, -- @Budget_Hit_Rate	@Budget_Customer_Type 	nvarchar(200)
    'Building Construction', -- @Budget_Nature_Of_Works	@Budget_Hit_Rate	decimal(18, 2) = 0.00,
    1.0, -- @Budget_Percentage_Shared	@Budget_Nature_Of_Works 	nvarchar(200)
    '15/9/2011', -- @Budget_Estimated_Completed_Date	@Budget_Percentage_Shared decimal(18, 2)	,
    Null, --@Budget_Actual_Completed_Date	@Budget_Estimated_Completed_Date datetime	,
    '2/8/2011', -- @Budget_Date_of_award	@Budget_Actual_Completed_Date datetime	,
    1,460,000.00, -- @Budget_Original_Contract_Sum	@Budget_Date_of_award datetime	,
    1,413,271.00,--@Budget_Estimated_Final_Contract_Sum	@Budget_Original_Contract_Sum	decimal(18, 2)
    1,407,430.95,--@Budget_Estimated_Final_Costs	@Budget_Estimated_Final_Contract_Sum	decimal(18, 2)
    5,840.05,--@Budget_Estimated_Final_Margin	@Budget_Estimated_Final_Costs	decimal(18, 2)
    '1/11/2011',--@CumTo_ForPeriod_YrMth	@Budget_Estimated_Final_Margin	decimal(18, 2)
    '1/12/2011',--@ForPeriodC9_YrMth	@CumTo_ForPeriod_YrMth	datetime
    '1/1/2012',--@ForPeriodC10_YrMth	@ForPeriodC9_YrMth	datetime
    '1/2/2012',--@ForPeriodC11_YrMth	@ForPeriodC10_YrMth	datetime
    '1/3/2012',--@ForPeriodC12_YrMth	@ForPeriodC11_YrMth	datetime
    '1/4/2012',--@ForPeriod1_YrMth	@ForPeriodC12_YrMth	datetime
    '1/5/2012',--@ForPeriod2_YrMth	@ForPeriod1_YrMth	datetime
    '1/6/2012',--@ForPeriod3_YrMth	@ForPeriod2_YrMth	datetime
    '1/7/2012',--@ForPeriod4_YrMth	@ForPeriod3_YrMth	datetime
    '1/8/2012',--@ForPeriod5_YrMth	@ForPeriod4_YrMth	datetime
    '1/9/2012',--@ForPeriod6_YrMth	@ForPeriod5_YrMth	datetime
    '1/10/2012',--@ForPeriod7_YrMth	@ForPeriod6_YrMth	datetime
    '1/11/2012',--@ForPeriod8_YrMth	@ForPeriod7_YrMth	datetime
    '1/12/2012',--@ForPeriod9_YrMth	@ForPeriod8_YrMth	datetime
    '1/1/2013',--@ForPeriod10_YrMth	@ForPeriod9_YrMth	datetime
    '1/2/2013',--@ForPeriod11_YrMth	@ForPeriod10_YrMth	datetime
    '1/3/2013',--@ForPeriod12_YrMth	@ForPeriod11_YrMth	datetime
    '1/4/2013',--@ForPeriod13_YrMth	@ForPeriod12_YrMth	datetime
    '1/5/2013',--@ForPeriod14_YrMth	@ForPeriod13_YrMth	datetime
    '1/6/2013',--@ForPeriod15_YrMth	@ForPeriod14_YrMth	datetime
    '1/7/2013',--@ForPeriod16_YrMth	@ForPeriod15_YrMth	datetime
    '1/8/2013',--@ForPeriod17_YrMth	@ForPeriod16_YrMth	datetime
    '1/9/2013',--@ForPeriod18_YrMth	@ForPeriod17_YrMth	datetime
    '1/10/2013',--@ForPeriod19_YrMth	@ForPeriod18_YrMth	datetime
    '1/11/2013',--@ForPeriod20_YrMth	@ForPeriod19_YrMth	datetime
    '1/12/2013',--@ForPeriod21_YrMth	@ForPeriod20_YrMth	datetime
    '1/1/2014',--@ForPeriod22_YrMth	@ForPeriod21_YrMth	datetime
    '1/2/2014',--@ForPeriod23_YrMth	@ForPeriod22_YrMth	datetime
    '1/3/2014',--@ForPeriod24_YrMth	@ForPeriod23_YrMth	datetime
    'After Mar-14', -- @ForPeriod_After_YrMth	@ForPeriod24_YrMth	datetime
    '4 Mths to Mar-12', -- @Total_Budget_Four_Mths_to_1	@ForPeriod_After_YrMth nvarchar(150),	
    'Cum to Mar-12', -- @Cum_Four_Mths_to_1	@Total_Budget_Four_Mths_to_1 nvarchar(150),	
    '12 Mths to Mar-13', -- @Total_Twelve_Mths_to_1	@Cum_Four_Mths_to_1 nvarchar(150),	
    'Cum to Mar-13',-- @Cum_Twelve_Mths_to_1	@Total_Twelve_Mths_to_1 nvarchar(150),	
    '12 Mths to Mar-14',-- @Total_Twelve_Mths_to_2	@Cum_Twelve_Mths_to_1 nvarchar(150),	
    'Total', -- @Total_All	@Total_Twelve_Mths_to_2 nvarchar(150),	
    @Budget_CashFlow_Worksheet_ID,--0, -- @Budget_CashFlow_Worksheet_ID	@Total_All nvarchar(150),	
    @Result	@Result nvarchar(4000) output	


    reach one variable gcd, mgcd begin to write

    Tuesday, May 22, 2012 2:49 AM

Answers

  • Delete ',' in the sum. It might take it as next column value
    1,460,000.00, -- @Budget_Original_Contract_Sum
    1,413,271.00,--@Budget_Estimated_Final_Contract_Sum
    1,407,430.95,--@Budget_Estimated_Final_Costs
    5,840.05,--@Budget_Estimated_Final_Margin
    use 
    1460000.000
    etc


    ESHANI. Please click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

    • Marked as answer by 沈世鈞 Tuesday, May 22, 2012 4:12 AM
    Tuesday, May 22, 2012 3:04 AM
  • run successfully

    declare @Result nvarchar(4000)
    declare @Budget_CashFlow_Worksheet_ID int
    exec sp_Budget_CashFlow_Worksheet_Update 56, -- @Budget_CashFlow_Header_ID
    '00000B3H', -- @Budget_CashFlow_Worksheet_Name
    '2013-3-1 00:00:00', -- @YrEnd_Date
    'Unsecured', -- @Budget_Project_On_Hand_Status
    'Template-Project (HK & Macau).xls', -- @Upload_FileName
    'N/A', -- @Budget_Main_Contractor_ProjectNo
    'N/A', --@Budget_Main_Contractor
    'PYBL', -- @Budget_Company_Name
    'Office Development at ABC St', -- @Budget_Project_Name
    '00000B3H', -- @Budget_Project_No
    'Hutchison', -- @Budget_Customer_Name
    'Private', -- @Budget_Customer_Type
    1.00, -- @Budget_Hit_Rate
    'Building Construction', -- @Budget_Nature_Of_Works
    1.0, -- @Budget_Percentage_Shared
    '2011-9-15 00:00:00', -- @Budget_Estimated_Completed_Date
    Null, --@Budget_Actual_Completed_Date
    '2011-8-2 00:00:00', -- @Budget_Date_of_award
    1460000.00, -- @Budget_Original_Contract_Sum
    1413271.00,--@Budget_Estimated_Final_Contract_Sum
    1407430.95,--@Budget_Estimated_Final_Costs
    5840.05,--@Budget_Estimated_Final_Margin
    '2011-11-1 00:00:00',--@CumTo_ForPeriod_YrMth
    '2011-12-1 00:00:00',--@ForPeriodC9_YrMth
    '2012-1-1 00:00:00',--@ForPeriodC10_YrMth
    '2012-2-1 00:00:00',--@ForPeriodC11_YrMth
    '2012-3-1 00:00:00',--@ForPeriodC12_YrMth
    '2012-4-1 00:00:00',--@ForPeriod1_YrMth
    '2012-5-1 00:00:00',--@ForPeriod2_YrMth
    '2012-6-1 00:00:00',--@ForPeriod3_YrMth
    '2012-7-1 00:00:00',--@ForPeriod4_YrMth
    '2012-8-1 00:00:00',--@ForPeriod5_YrMth
    '2012-9-1 00:00:00',--@ForPeriod6_YrMth
    '2012-10-1 00:00:00',--@ForPeriod7_YrMth
    '2012-11-1 00:00:00',--@ForPeriod8_YrMth
    '2012-12-1 00:00:00',--@ForPeriod9_YrMth
    '2013-1-1 00:00:00',--@ForPeriod10_YrMth
    '2013-2-1 00:00:00',--@ForPeriod11_YrMth
    '2013-3-1 00:00:00',--@ForPeriod12_YrMth
    '2013-4-1 00:00:00',--@ForPeriod13_YrMth
    '2013-5-1 00:00:00',--@ForPeriod14_YrMth
    '2013-6-1 00:00:00',--@ForPeriod15_YrMth
    '2013-7-1 00:00:00',--@ForPeriod16_YrMth
    '2013-8-1 00:00:00',--@ForPeriod17_YrMth
    '2013-9-1 00:00:00',--@ForPeriod18_YrMth
    '2013-10-1 00:00:00',--@ForPeriod19_YrMth
    '2013-11-1 00:00:00',--@ForPeriod20_YrMth
    '2013-12-1 00:00:00',--@ForPeriod21_YrMth
    '2014-1-1 00:00:00',--@ForPeriod22_YrMth
    '2014-2-1 00:00:00',--@ForPeriod23_YrMth
    '2014-3-1 00:00:00',--@ForPeriod24_YrMth
    'After Mar-14', -- @ForPeriod_After_YrMth
    '4 Mths to Mar-12', -- @Total_Budget_Four_Mths_to_1
    'Cum to Mar-12', -- @Cum_Four_Mths_to_1
    '12 Mths to Mar-13', -- @Total_Twelve_Mths_to_1
    'Cum to Mar-13',-- @Cum_Twelve_Mths_to_1
    '12 Mths to Mar-14',-- @Total_Twelve_Mths_to_2
    'Total', -- @Total_All
    @Budget_CashFlow_Worksheet_ID,--0, -- @Budget_CashFlow_Worksheet_ID
    @Result
    Print @Result



    reach one variable gcd, mgcd begin to write


    • Edited by 沈世鈞 Tuesday, May 22, 2012 4:12 AM
    • Marked as answer by 沈世鈞 Tuesday, May 22, 2012 4:12 AM
    Tuesday, May 22, 2012 4:11 AM

All replies

  • Delete ',' in the sum. It might take it as next column value
    1,460,000.00, -- @Budget_Original_Contract_Sum
    1,413,271.00,--@Budget_Estimated_Final_Contract_Sum
    1,407,430.95,--@Budget_Estimated_Final_Costs
    5,840.05,--@Budget_Estimated_Final_Margin
    use 
    1460000.000
    etc


    ESHANI. Please click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

    • Marked as answer by 沈世鈞 Tuesday, May 22, 2012 4:12 AM
    Tuesday, May 22, 2012 3:04 AM
  • Check the total number of parameters you passed to the SP against the real codes. You did put more arguments than it should be there!

    Many Thanks & Best Regards, Hua Min

    Tuesday, May 22, 2012 3:05 AM
  • how about this Error converting data type varchar to datetime.


    reach one variable gcd, mgcd begin to write

    Tuesday, May 22, 2012 3:23 AM
  • Please see the below link for the reason/cause of this error.

    http://www.expertsupdates.com/sqlservererrormessage-tutorials/sql-server-error-messages-msg-8144-11.aspx


    ESHANI. Please click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

    Tuesday, May 22, 2012 3:27 AM
  • how about this Error converting data type varchar to datetime.


    reach one variable gcd, mgcd begin to write

    Do like this

    select CONVERT(datetime,'08/12/2009',101)
    go


    Many Thanks & Best Regards, Hua Min

    Tuesday, May 22, 2012 3:33 AM
  • Msg 156, Level 15, State 1, Line 5
    Incorrect syntax near the keyword 'convert'.

    declare @Result nvarchar(4000)
    declare @Budget_CashFlow_Worksheet_ID int
    exec sp_Budget_CashFlow_Worksheet_Update 56, -- @Budget_CashFlow_Header_ID
    '00000B3H', -- @Budget_CashFlow_Worksheet_Name
    convert(datetime, '1/3/2013', 101), -- @YrEnd_Date
    'Unsecured', -- @Budget_Project_On_Hand_Status
    'Template-Project (HK & Macau).xls', -- @Upload_FileName
    'N/A', -- @Budget_Main_Contractor_ProjectNo
    'N/A', --@Budget_Main_Contractor
    'PYBL', -- @Budget_Company_Name
    'Office Development at ABC St', -- @Budget_Project_Name
    '00000B3H', -- @Budget_Project_No
    'Hutchison', -- @Budget_Customer_Name
    'Private', -- @Budget_Customer_Type
    1.00, -- @Budget_Hit_Rate
    'Building Construction', -- @Budget_Nature_Of_Works
    1.0, -- @Budget_Percentage_Shared
    convert(datetime, '15/9/2011', 101), -- @Budget_Estimated_Completed_Date
    Null, --@Budget_Actual_Completed_Date
    convert(datetime, '2/8/2011', 101), -- @Budget_Date_of_award
    1460000.00, -- @Budget_Original_Contract_Sum
    1413271.00,--@Budget_Estimated_Final_Contract_Sum
    1407430.95,--@Budget_Estimated_Final_Costs
    5840.05,--@Budget_Estimated_Final_Margin
    convert(datetime, '1/11/2011', 101),--@CumTo_ForPeriod_YrMth
    convert(datetime, '1/12/2011', 101),--@ForPeriodC9_YrMth
    convert(datetime, '1/1/2012', 101),--@ForPeriodC10_YrMth
    convert(datetime, '1/2/2012', 101),--@ForPeriodC11_YrMth
    convert(datetime, '1/3/2012', 101),--@ForPeriodC12_YrMth
    convert(datetime, '1/4/2012', 101),--@ForPeriod1_YrMth
    convert(datetime, '1/5/2012', 101),--@ForPeriod2_YrMth
    convert(datetime, '1/6/2012', 101),--@ForPeriod3_YrMth
    convert(datetime, '1/7/2012', 101),--@ForPeriod4_YrMth
    convert(datetime, '1/8/2012', 101),--@ForPeriod5_YrMth
    convert(datetime, '1/9/2012', 101),--@ForPeriod6_YrMth
    convert(datetime, '1/10/2012', 101),--@ForPeriod7_YrMth
    convert(datetime, '1/11/2012', 101),--@ForPeriod8_YrMth
    convert(datetime, '1/12/2012', 101),--@ForPeriod9_YrMth
    convert(datetime, '1/1/2013', 101),--@ForPeriod10_YrMth
    convert(datetime, '1/2/2013', 101),--@ForPeriod11_YrMth
    convert(datetime, '1/3/2013', 101),--@ForPeriod12_YrMth
    convert(datetime, '1/4/2013', 101),--@ForPeriod13_YrMth
    convert(datetime, '1/5/2013', 101),--@ForPeriod14_YrMth
    convert(datetime, '1/6/2013', 101),--@ForPeriod15_YrMth
    convert(datetime, '1/7/2013', 101),--@ForPeriod16_YrMth
    convert(datetime, '1/8/2013', 101),--@ForPeriod17_YrMth
    convert(datetime, '1/9/2013', 101),--@ForPeriod18_YrMth
    convert(datetime, '1/10/2013', 101),--@ForPeriod19_YrMth
    convert(datetime, '1/11/2013', 101),--@ForPeriod20_YrMth
    convert(datetime, '1/12/2013', 101),--@ForPeriod21_YrMth
    convert(datetime, '1/1/2014', 101),--@ForPeriod22_YrMth
    convert(datetime, '1/2/2014', 101),--@ForPeriod23_YrMth
    convert(datetime, '1/3/2014', 101),--@ForPeriod24_YrMth
    'After Mar-14', -- @ForPeriod_After_YrMth
    '4 Mths to Mar-12', -- @Total_Budget_Four_Mths_to_1
    'Cum to Mar-12', -- @Cum_Four_Mths_to_1
    '12 Mths to Mar-13', -- @Total_Twelve_Mths_to_1
    'Cum to Mar-13',-- @Cum_Twelve_Mths_to_1
    '12 Mths to Mar-14',-- @Total_Twelve_Mths_to_2
    'Total', -- @Total_All
    @Budget_CashFlow_Worksheet_ID,--0, -- @Budget_CashFlow_Worksheet_ID
    @Result


    reach one variable gcd, mgcd begin to write

    Tuesday, May 22, 2012 3:43 AM
  • run successfully

    declare @Result nvarchar(4000)
    declare @Budget_CashFlow_Worksheet_ID int
    exec sp_Budget_CashFlow_Worksheet_Update 56, -- @Budget_CashFlow_Header_ID
    '00000B3H', -- @Budget_CashFlow_Worksheet_Name
    '2013-3-1 00:00:00', -- @YrEnd_Date
    'Unsecured', -- @Budget_Project_On_Hand_Status
    'Template-Project (HK & Macau).xls', -- @Upload_FileName
    'N/A', -- @Budget_Main_Contractor_ProjectNo
    'N/A', --@Budget_Main_Contractor
    'PYBL', -- @Budget_Company_Name
    'Office Development at ABC St', -- @Budget_Project_Name
    '00000B3H', -- @Budget_Project_No
    'Hutchison', -- @Budget_Customer_Name
    'Private', -- @Budget_Customer_Type
    1.00, -- @Budget_Hit_Rate
    'Building Construction', -- @Budget_Nature_Of_Works
    1.0, -- @Budget_Percentage_Shared
    '2011-9-15 00:00:00', -- @Budget_Estimated_Completed_Date
    Null, --@Budget_Actual_Completed_Date
    '2011-8-2 00:00:00', -- @Budget_Date_of_award
    1460000.00, -- @Budget_Original_Contract_Sum
    1413271.00,--@Budget_Estimated_Final_Contract_Sum
    1407430.95,--@Budget_Estimated_Final_Costs
    5840.05,--@Budget_Estimated_Final_Margin
    '2011-11-1 00:00:00',--@CumTo_ForPeriod_YrMth
    '2011-12-1 00:00:00',--@ForPeriodC9_YrMth
    '2012-1-1 00:00:00',--@ForPeriodC10_YrMth
    '2012-2-1 00:00:00',--@ForPeriodC11_YrMth
    '2012-3-1 00:00:00',--@ForPeriodC12_YrMth
    '2012-4-1 00:00:00',--@ForPeriod1_YrMth
    '2012-5-1 00:00:00',--@ForPeriod2_YrMth
    '2012-6-1 00:00:00',--@ForPeriod3_YrMth
    '2012-7-1 00:00:00',--@ForPeriod4_YrMth
    '2012-8-1 00:00:00',--@ForPeriod5_YrMth
    '2012-9-1 00:00:00',--@ForPeriod6_YrMth
    '2012-10-1 00:00:00',--@ForPeriod7_YrMth
    '2012-11-1 00:00:00',--@ForPeriod8_YrMth
    '2012-12-1 00:00:00',--@ForPeriod9_YrMth
    '2013-1-1 00:00:00',--@ForPeriod10_YrMth
    '2013-2-1 00:00:00',--@ForPeriod11_YrMth
    '2013-3-1 00:00:00',--@ForPeriod12_YrMth
    '2013-4-1 00:00:00',--@ForPeriod13_YrMth
    '2013-5-1 00:00:00',--@ForPeriod14_YrMth
    '2013-6-1 00:00:00',--@ForPeriod15_YrMth
    '2013-7-1 00:00:00',--@ForPeriod16_YrMth
    '2013-8-1 00:00:00',--@ForPeriod17_YrMth
    '2013-9-1 00:00:00',--@ForPeriod18_YrMth
    '2013-10-1 00:00:00',--@ForPeriod19_YrMth
    '2013-11-1 00:00:00',--@ForPeriod20_YrMth
    '2013-12-1 00:00:00',--@ForPeriod21_YrMth
    '2014-1-1 00:00:00',--@ForPeriod22_YrMth
    '2014-2-1 00:00:00',--@ForPeriod23_YrMth
    '2014-3-1 00:00:00',--@ForPeriod24_YrMth
    'After Mar-14', -- @ForPeriod_After_YrMth
    '4 Mths to Mar-12', -- @Total_Budget_Four_Mths_to_1
    'Cum to Mar-12', -- @Cum_Four_Mths_to_1
    '12 Mths to Mar-13', -- @Total_Twelve_Mths_to_1
    'Cum to Mar-13',-- @Cum_Twelve_Mths_to_1
    '12 Mths to Mar-14',-- @Total_Twelve_Mths_to_2
    'Total', -- @Total_All
    @Budget_CashFlow_Worksheet_ID,--0, -- @Budget_CashFlow_Worksheet_ID
    @Result
    Print @Result



    reach one variable gcd, mgcd begin to write


    • Edited by 沈世鈞 Tuesday, May 22, 2012 4:12 AM
    • Marked as answer by 沈世鈞 Tuesday, May 22, 2012 4:12 AM
    Tuesday, May 22, 2012 4:11 AM
  • run successfully

    declare @Result nvarchar(4000)
    declare @Budget_CashFlow_Worksheet_ID int
    exec sp_Budget_CashFlow_Worksheet_Update 56, -- @Budget_CashFlow_Header_ID
    '00000B3H', -- @Budget_CashFlow_Worksheet_Name
    '2013-3-1 00:00:00', -- @YrEnd_Date
    'Unsecured', -- @Budget_Project_On_Hand_Status
    'Template-Project (HK & Macau).xls', -- @Upload_FileName
    'N/A', -- @Budget_Main_Contractor_ProjectNo
    'N/A', --@Budget_Main_Contractor
    'PYBL', -- @Budget_Company_Name
    'Office Development at ABC St', -- @Budget_Project_Name
    '00000B3H', -- @Budget_Project_No
    'Hutchison', -- @Budget_Customer_Name
    'Private', -- @Budget_Customer_Type
    1.00, -- @Budget_Hit_Rate
    'Building Construction', -- @Budget_Nature_Of_Works
    1.0, -- @Budget_Percentage_Shared
    '2011-9-15 00:00:00', -- @Budget_Estimated_Completed_Date
    Null, --@Budget_Actual_Completed_Date
    '2011-8-2 00:00:00', -- @Budget_Date_of_award
    1460000.00, -- @Budget_Original_Contract_Sum
    1413271.00,--@Budget_Estimated_Final_Contract_Sum
    1407430.95,--@Budget_Estimated_Final_Costs
    5840.05,--@Budget_Estimated_Final_Margin
    '2011-11-1 00:00:00',--@CumTo_ForPeriod_YrMth
    '2011-12-1 00:00:00',--@ForPeriodC9_YrMth
    '2012-1-1 00:00:00',--@ForPeriodC10_YrMth
    '2012-2-1 00:00:00',--@ForPeriodC11_YrMth
    '2012-3-1 00:00:00',--@ForPeriodC12_YrMth
    '2012-4-1 00:00:00',--@ForPeriod1_YrMth
    '2012-5-1 00:00:00',--@ForPeriod2_YrMth
    '2012-6-1 00:00:00',--@ForPeriod3_YrMth
    '2012-7-1 00:00:00',--@ForPeriod4_YrMth
    '2012-8-1 00:00:00',--@ForPeriod5_YrMth
    '2012-9-1 00:00:00',--@ForPeriod6_YrMth
    '2012-10-1 00:00:00',--@ForPeriod7_YrMth
    '2012-11-1 00:00:00',--@ForPeriod8_YrMth
    '2012-12-1 00:00:00',--@ForPeriod9_YrMth
    '2013-1-1 00:00:00',--@ForPeriod10_YrMth
    '2013-2-1 00:00:00',--@ForPeriod11_YrMth
    '2013-3-1 00:00:00',--@ForPeriod12_YrMth
    '2013-4-1 00:00:00',--@ForPeriod13_YrMth
    '2013-5-1 00:00:00',--@ForPeriod14_YrMth
    '2013-6-1 00:00:00',--@ForPeriod15_YrMth
    '2013-7-1 00:00:00',--@ForPeriod16_YrMth
    '2013-8-1 00:00:00',--@ForPeriod17_YrMth
    '2013-9-1 00:00:00',--@ForPeriod18_YrMth
    '2013-10-1 00:00:00',--@ForPeriod19_YrMth
    '2013-11-1 00:00:00',--@ForPeriod20_YrMth
    '2013-12-1 00:00:00',--@ForPeriod21_YrMth
    '2014-1-1 00:00:00',--@ForPeriod22_YrMth
    '2014-2-1 00:00:00',--@ForPeriod23_YrMth
    '2014-3-1 00:00:00',--@ForPeriod24_YrMth
    'After Mar-14', -- @ForPeriod_After_YrMth
    '4 Mths to Mar-12', -- @Total_Budget_Four_Mths_to_1
    'Cum to Mar-12', -- @Cum_Four_Mths_to_1
    '12 Mths to Mar-13', -- @Total_Twelve_Mths_to_1
    'Cum to Mar-13',-- @Cum_Twelve_Mths_to_1
    '12 Mths to Mar-14',-- @Total_Twelve_Mths_to_2
    'Total', -- @Total_All
    @Budget_CashFlow_Worksheet_ID,--0, -- @Budget_CashFlow_Worksheet_ID
    @Result
    Print @Result



    reach one variable gcd, mgcd begin to write


    Now check your SP codes to see why no data is retrieved!

    Many Thanks & Best Regards, Hua Min

    Tuesday, May 22, 2012 4:14 AM