title: Conversion failed when converting the varchar value '1,3' to data type int in SQL Server
body: <p>In the below query when i try to delete comma separated values it throw a error "Conversion failed when converting the varchar value '1,3' to data type int.".Pls help me to overcome this issue.</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[spDeleteCustomerGroupLocationMap]
      -- Add the parameters for the stored procedure here
      @i_LocationID int,
      @i_CustomerGroupID varchar
  
      --WITH ENCRYPTION
  AS
  BEGIN
      -- SET NOCOUNT ON added to prevent extra result sets from
      -- interfering with SELECT statements.
      SET NOCOUNT ON;
  
      -- Insert statements for procedure here
      IF EXISTS (SELECT 1 FROM CustomerGroupLocationMap WHERE LocationID = @i_LocationID AND CustomerGroupID = @i_CustomerGroupID)
      BEGIN
  
          DELETE CustomerGroupLocationMap WHERE  LocationID = @i_LocationID AND CustomerGroupID = (SELECT * FROM dbo.CSVToTable( @i_CustomerGroupID));
  
      END
  END
  </code></pre>