Click here to Skip to main content
15,922,533 members

Comments by Martin@eg (Top 3 by date)

Martin@eg 28-Aug-13 12:11pm View    
I really appreciate your help, but as stated, the stored procedure works fine until the returnvalue parameter is added. Here is the stored procedure header itself:

ALTER PROCEDURE [dbo].[ukgas_timesheets_disbs_update]
@p_employee_login varchar(10),
@p_start_date datetime,
--Timesheet fields
@p_ts_job_contracts varchar(220),
@p_mondays varchar(100),
@p_tuesdays varchar(100),
@p_wednesdays varchar(100),
@p_thursdays varchar(100),
@p_fridays varchar(100),
@p_saturdays varchar(100),
@p_sundays varchar(100),
@p_ts_categories varchar(140),
--Disbursement fields
@p_disb_uniques varchar(220) output,
@p_disb_actions varchar(40),
@p_disb_dates varchar(220),
@p_disb_job_contracts varchar(220),
@p_claim_values varchar(160),
@p_vat_elements varchar(160),
@p_claim_backs varchar(40),
@p_disb_categories varchar(140),
@p_details varchar(1020)
AS

I must be doing something wrong since there are no other similar questions out on the internet, but perhaps it is not a widely used facility. I did see some comment that Microsoft are trying to discourage its use, but I have used this facility for many years with no issues.

Thank you
Martin@eg 28-Aug-13 4:16am View    
I have put as the first parameter and the last and both cause the same error. Any other ideas?
Martin@eg 27-Aug-13 19:47pm View    
Tks for responding. The semicolon got added when I pasted the code in so it is not really there. I know that I do not need the @ in front of the parameter name, but it has never really been a problem.

As explained above, when I add the return value parameter, it is no longer possible to execute the command without an error. The exact line that I am adding is:

.Parameters.Add(New SqlClient.SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue))

As you can see, it does indeed specify that it is a returnvalue.

It is absolutely clear that no one else seems to have this problem after searching on google for days on end. Can you think why this doesn't work in my case?