Home All Groups Group Topic Archive Search About

Unlimited NVarChar datasize in params

Author
13 Apr 2007 3:02 PM
Earl
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
issues.

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?

AddThis Social Bookmark Button