title: How to pass multiple values in one parameter to SP
body: <p>I want to pass a parameter to stored procedure but with multiple values and place it in Where condition as IN (Values)</p>
  
  <p>My SP:</p>
  
  <pre><code>    ALTER PROCEDURE [dbo].[GetPoliciesPageWise]
      (
         @PageIndex INT = 1
        ,@PageSize INT = 10
        ,@RecordCount INT OUTPUT 
      )
  AS
  
  BEGIN
  
        SET NOCOUNT ON;
  
        SELECT ROW_NUMBER() OVER
        (ORDER BY [ID] ASC)AS RowNumber
       ,[ID]  
       ,[PolicyNumber]
       ,[FileName]
       ,[FileBarcode]
       ,[BoxBarcode]
       ,[CityID]
       ,[DocTypeID]
       ,[ProdcutType]
       ,[CategoryID]
       ,[TotalImages]
       ,[PIN]
       ,[PolicyHolder]
       ,[IDNo]
       ,[BranchID]
       ,[IntroducerID]
       ,[IssueDate]
       ,[FilePath] 
       ,[BranchName]
       ,[DocType]
   INTO #Results
    FROM dbo.Polices
    SELECT @RecordCount = COUNT(*) 
    FROM #Results
    SELECT * FROM #Results
  
    WHERE RowNumber BETWEEN(@PageIndex -1) * @PageSize + 1 AND(((@PageIndex -1) * @PageSize + 1) +     @PageSize) - 1
  
    DROP TABLE #Results
  
  END
  </code></pre>
  
  <p>What i need is to pass multiple policies and filter the result based on that.
  also i need this parameter as defualt if it is empty i need to select without insert it in the Where condtion
  I am using SQL Server 2008 R2.</p>