Unlimited NVarChar datasize in params



It's been obvious to me since VS2005 came out that the new param generator
for the SqlDataAdapter spits out NVarChar character lengths as 0, with no
apparent problems passing those values to the database (SQL2005). I've been
using the auto-generated params as-is for quite a long time with no apparent

New System.Data.SqlClient.SqlParameter("@ProductService",
System.Data.SqlDbType.NVarChar, 0, "ProductService")

But what is not obvious is whether there is a hit to performance passing the
0, for what I speculate to mean "unlimited" size of the NVarChar column.
Does anyone know the answer to this with any definitiveness? Anyone know
what the logic was behind the param generation of 0?


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

Similar Threads