Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output Assigned to Position not Name of Stored Procedure Parameter 1

Status
Not open for further replies.

SeanGriffin

Programmer
Feb 23, 2001
99
US
I was wondering if anyone could tell me why this happened.

I have a Stored Procedure in SQL 2000 where when I define it as follows it works the way I expect it to.

Code:
CREATE PROCEDURE [dbo].[addSequenceBinaryData]
@sequenceID int,
@testData image,
@fileName varchar(255),
@retval bigint OUTPUT, 
@ReplacedBy int = null,
@rowguid uniqueidentifier = null

However if I reorder the Parameters it always treats the fourth value as an output even though I move the output statment with the @retval parameter. Example:


Code:
CREATE PROCEDURE [dbo].[addSequenceBinaryData]
@sequenceID int,
@testData image,
@fileName varchar(255),
@ReplacedBy int = null,
@rowguid uniqueidentifier = null,
@retval bigint OUTPUT

@ReplacedBy is treated as an output and I get errors because I don't specify it as one when calling it.

Any Suggestions would be much appreciated.

-Sean

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top