What size do you use for varchar(MAX) in your parameter declaration?

mrblah picture mrblah · Jun 10, 2009 · Viewed 108.7k times · Source

I normally set my column size when creating a parameter in ADO.NET

But what size do I use if the column is VARCHAR(MAX)?

cmd.Parameters.Add("@blah", SqlDbType.VarChar, ?????).Value = blah;

Answer

Michał Chaniewski picture Michał Chaniewski · Jun 10, 2009

In this case you use -1.