i have a mssql sp which one of it's arguments is table-valued. i want to pass an array of int's to it from laravel project. i tried this :
DB::connection("sqlsrv")->select(
"Exec spName @table-valuedParam=?, param2=?.., array(arrayofInt, param2..) )
and i get the error : parameter mismatch, pattern need string but array given.
my purpose is to select records from table which id's in the the that array, actually the sp contain a section like this where id in (@idList) i using table-valued but can pass an array from laravel to it. how can do this?
is there any way to do this job? sorry for my bad English
after searching a lot i get an answer. i pass user selected id's as a string with comma seperated and create a sql server function which do the split job and return a table of int's and then i use where clause like : select * from mytable where id in (select * from sqlsrvFunc(@idsStr) it's worked porfectly