title: Constructing SQL Server stored procedure for array Input
body: <p>I am struggling with this. I have looked at <a href="http://www.sommarskog.se/arrays-in-sql-2008.html" rel="nofollow noreferrer">Table Level Variables</a> but I am thinking this is way beyond my simple understanding at this stage of SQL.</p>
  
  <p>The issue I have created is I have an array of ID values I am generating inside MS Access as a result of some other tasks in there. I am wanting to send these over to SQL Server to grab the jobs with the ID number that matches.</p>
  
  <pre><code>SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  
  ALTER PROCEDURE [dbo].[get_Job] 
      @jobID VARCHAR,
      @JobIDs id_List READONLY 
  AS
  BEGIN
      SELECT @JobID AS JobID; 
  
      SELECT * 
      FROM Job
  END;
  </code></pre>
  
  <p>Is my current stored procedure, however whilst I have been able to get it to return the <code>JobID</code> variable any list I added generates an error. If I insert only 1 ID into <code>JobIDs</code>, this doesn't generate a result either.</p>
  
  <p>As I said I think I am punching well above my weight and am getting a bit lost in all this. Perhaps I can be directed to a better training resource or a site that explains this in baby steps or a book I can purchase to help me understand this? I would appreciate help with fixing the errors above but a fish teaching is probably better.</p>
  
  <p>Thanks in advance</p>