title: What is the maximum length of a string parameter to Stored procedure?
body: <p>I have a string of length 1,44,000 which has to be passed as a parameter to a stored procedure which is a select query on a table.
  When a give this is in a query (in c# ) its working fine. But when i pass it as a parameter to stored procedure its not working.</p>
  
  <p>Here is my stored procedure where in i have declared this parameter as NVARCHAR(MAX)</p>
  
  <pre><code>------------------------------------------------------
  set ANSI_NULLS ON
  set QUOTED_IDENTIFIER ON
  go
  
  CREATE PROCEDURE [dbo].[ReadItemData](@ItemNames NVARCHAR(MAX),@TimeStamp as DATETIME)
  
  AS
  
  select * from ItemData
  
  where ItemName in (@ItemNames) AND TimeStamp=@TimeStamp
  
  ---------------------------------------------------------------------
  </code></pre>
  
  <p>Here the parameter @ItemNames is a string concatinated with different names such as 
  'Item1','Item2','Item3'....etc.</p>
  
  <p>Can anyone tell what went wrong here?</p>
  
  <p>Thanks &amp; Regards</p>
  
  <p>Padma </p>