title: the replace function requires 3 arguments
body: <p>im trying to add "Store" into reporting service as a parameter. this is my code:</p>
  
  <pre><code>DECLARE @Store      nvarchar(MAX)
  DECLARE @Delimiter  char
  DECLARE @x          XML
  
  IF OBJECT_ID('tempdb..#Store') IS NOT NULL
  DROP TABLE #Store
  
  CREATE TABLE #Store
  (
  Store_No int
  )
  
  SET @Delimiter = ','
  SET @Store = '3,38'
  SELECT @x = CAST('&lt;i&gt;' + REPLACE(@Store, @Delimiter, '&lt;/i&gt;&lt;i&gt;') + '&lt;/i&gt;' AS XML)
  INSERT INTO #Store (Store_No)
  SELECT
      x.value('.','int')
  FROM
      @x.nodes('/*') n(x)
  </code></pre>
  
  <p>this works when i put 1 number in such as 3, however, when I put 2 or more, it gives me error called "the replace function requires 3 arguments"</p>
  
  <p>any idea how can i fix this? thanks alot!</p>