title: declaring T-Sql parameter for comma delimited list of integers
body: <p>I have a table that contains a list of performances. These performances are grouped by production number. What I am trying to do is create a stored procedure that will return the last performance for each production entered. I would like to be able to input the production ids as a list of ids. Below is my procedure so far. Difficulty is I'm not sure how best to declare the @prod_no parameter to be used in the IN statement.</p>
  
  <pre><code>CREATE PROCEDURE IP_MAX_PERF_DATE 
  -- Add the parameters for the stored procedure here
  @prod_no 
  AS
  BEGIN
  -- SET NOCOUNT ON added to prevent extra result sets from
  -- interfering with SELECT statements.
  SET NOCOUNT ON;
  
  -- Insert statements for procedure here
  SELECT [prod_season_no], MAX([perf_dt]) As max_dt FROM [T_PERF] WHERE [prod_season_no] IN (@prod)
  GROUP By [prod_season_no];
  END
  GO
  </code></pre>
  
  <p>Any ideas</p>