Skip to content

Passing TVP along with other parameters #1815

Closed

Description

@briantheusch

Using Microsoft.Data.SqlClient, when I pass a TVP along with any other parameters into an MSSQL Stored Procedure I receive an error that the other parameter does not exist, even though when debugging, it clearly exists and was assigned to the command. If I change the Stored Procedure/code and pass a TVP to a stored procedure without any other parameters it appears to work fine.

In my opinion, you should be able to pass other individual parameters along with a TVP into a Stored Procedure as to not need to duplicate fixed data inside of the TVP itself. This appears to be different from the older System.Data.SqlClient, and does not work with the newer Microsoft.Data.SqlClient package.

Activity

  1. ErikEJ commented on Oct 25, 2022

    @ErikEJ
    Contributor

    Please share a runnable repo. There should be no difference between the two drivers.

  2. briantheusch commented on Oct 25, 2022

    @briantheusch
    Author

    Thanks for the quick response. I'll need to put together something and unfortunately I'm under a bit of a deadline right now/it will take a few days to build out something. Thanks again. I'll need to double check but I'm fairly certain this is different behavior from the previous version.

  3. JRahnama commented on Oct 25, 2022

    @JRahnama
    Contributor

    @briantheusch as @ErikEJ mentioned, a repro would help us a lot to understand the situation.

  4. briantheusch commented on Oct 26, 2022

    @briantheusch
    Author

    Disregard - this was a unintentional bug in my code. I apologize and thank you again for the prompt response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions