Mismatch between passed table valued parameter and User-defined table type RRS feed

  • Question

  • I have created a user define Table Type with two columns viz. Id and Value (both are nullable). Now from my application I am passing a datatable with only one column and the column name is "Id".

    My expectation was it would populate only the "Id" column with the values and keep the "Value" column NULL. 

    But I am getting an error stating "Trying to pass a table valued parameter with 1 column(s) where the corresponding user-defined table type requires 2 column(s).

    Is it possible to pass a one column datatable as a parameter to the 2 column user defined table type.

    Regards, digital
    Success is 3-D coz it demands Desire, Determination and Dedication.
    • Moved by Bob Beauchemin Wednesday, September 15, 2010 2:10 PM Moved to a more relevent forum (From:.NET Framework inside SQL Server)
    • Moved by Jackie-SunModerator Wednesday, July 6, 2011 3:37 AM (From:ADO.NET Managed Providers)
    Wednesday, September 15, 2010 9:47 AM

All replies