Skip to content

Bug: Parameter not supplied error when executing stored procedure #793

Open
@Simon-Carr

Description

@Simon-Carr

Bug Description

When trying to execute a stored procedure I get a missing parameter exception. I have tried this with both the async and non-async methods and with both methods of executing a stored procedure. I have also tried various permutations of providing the ProviderID parameter.

  ids = await cnn.ExecuteQueryAsync<int>("exec dbo.s_API_Subscriptions_DiscountsForProvider(@ProviderID);", new {request.ProviderID},
                        CommandType.StoredProcedure, cancellationToken: cancellationToken);
 ids = cnn.ExecuteQuery<int>("dbo.s_API_Subscriptions_DiscountsForProvider", new {ProviderID=1234},
                        CommandType.StoredProcedure);

If I remove the parameter from the stored procedure and execute without passing any parameters it works 👍

ids = await cnn.ExecuteQueryAsync<int>("dbo.s_API_Subscriptions_DiscountsForProvider", commandType:
                        CommandType.StoredProcedure, cancellationToken: cancellationToken);

Exception Message:

Procedure or function 's_API_Subscriptions_DiscountsForProvider' expects parameter '@ProviderID', which was not supplied.

The stored procedure implementation is very simple:

CREATE OR ALTER PROCEDURE dbo.s_API_Subscriptions_DiscountsForProvider
	@ProviderID INT
AS
BEGIN

Library Version:

Example: RepoDb v1.12.7 and RepoDb.SqlServer v1.1.3

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwontfixThis will not be worked onworking-as-expectedThe reported issue is working as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions