title: Call MS SQL Server Stored Procedure with multiple parameters inclusive of table-value parameter
body: <p>After doing some research here and online I am at a loss as to whether this is possible.  What I want to do is call a stored procedure that has several parameters one of which is a table-value parameter.</p>
  
  <p>This is my stored procedure snippet:</p>
  
  <pre><code>    ALTER PROCEDURE [dbo].[procName]
  @Action nvarchar(10) = 'view'
  ,@var1 int = 0
  ,@var2 int = 0
  ,@var3 myType ReadOnly
  </code></pre>
  
  <p>I now have another procedure (proc2) that has the following lines:</p>
  
  <pre><code>    insert into @varX
      select top 5
          field1, field2
      from
          sourceTable
  print 'Processing from table values...'
  exec dbo.procName  'refresh', -1, 0, @varX
  </code></pre>
  
  <p>Note that varX and var3 are of the same type MyType
  When I execute proc2 I get the error that I am specifying too many arguments for dbo.procName</p>
  
  <p>I am at the point in thinking it is not possible to specify multiple parameters inclusive of a table-value parameter to a stored procedure.  I am now tending towards the thought of changing my procName definition to only have one parameter (as all of the examples online seem to have) and have my table-value paramter act as an array of parameter values inclusive of the information I had in my previous select statement (in proc2). If however it is possible to do this call, please illustrate how this is done.  </p>
  
  <p>Thanks</p>