Store Multi Values in one parameter

  • i design SP for insert data in 2 tables

    i need to store list of array in one parameter to complete my query

    i try the table value but it`s not good for me because table value is readonly and i need to insert data with list of array ..........

  • Use the table-type parameter, that's the point of that data type.

    It's read-only within the proc that it's passed to, if that's a problem you can always create a table variable or temp table, insert the data from the parameter into the table variable or temp table and do further manipulation on that.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • aymanahmed88 (9/29/2015)


    i design SP for insert data in 2 tables

    i need to store list of array in one parameter to complete my query

    i try the table value but it`s not good for me because table value is readonly and i need to insert data with list of array ..........

    Gail's suggestion is excellent when the call is made from SQL code, where is the call to the procedure coming from?

    😎

  • Eirikur Eiriksson (9/29/2015)


    aymanahmed88 (9/29/2015)


    i design SP for insert data in 2 tables

    i need to store list of array in one parameter to complete my query

    i try the table value but it`s not good for me because table value is readonly and i need to insert data with list of array ..........

    Gail's suggestion is excellent when the call is made from SQL code

    Or .Net

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • call from MVC

  • We populate Table Valued Parameters from within MVC.

    I'm not a C# developer so can't help you with specifics,

    but our c# developers populate from the app which is MVC based.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply