Parameter Type/Size Property Values for VARCHAR(MAX) Stored Proc Parameter

J

jcpc

I have a SQL Server stored proc with a VARCHAR(MAX) output parameter.
What are the corresponding SqlParameter sqlDbType and size values?
 
A

Arne Vajhøj

I have a SQL Server stored proc with a VARCHAR(MAX) output parameter.
What are the corresponding SqlParameter sqlDbType and size values?

SqlDbType.VarChar and then either omit the size or specify
it as -1.

Arne
 
J

jcpc

Thanks, Arne! I never would have guessed (and haven't found it in any
documentation) that -1 can be used to imply a "max" value. I had
tried using a varchar parameter without the size value, but that works
only if direction = input.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top