SqlDbType sizes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a table of sizes to use for SqlDbTypes with SqlParameter constructor
such as:
SqlParameter("@VanId", SqlDbType.Int, 4"));

Not sure which types require a size and which ones can be left blank.

Thanks
 
If the type is fixed, for example, an Int is 4 bytes, then you should leave
it out. Look at the MSDN documentation for more information.
 
Christopher, thanks for the tip. I have looked at the MSDN docs, the
SqlDbType doesn't mention sizes of enumerated types and the SqlParameter docs
doesn't give any advice about which data types require the constructor with
size parameter. Just trying to say I did some homework first ;)
 
Back
Top