Parameters without precision, Column types with precision

  • Thread starter Thread starter Gustavo De la Espriella
  • Start date Start date
G

Gustavo De la Espriella

Hi, is there a problem if I declare parameters in stored procedures without
precision? For example:
"pFirstName nvarchar" instead of "pFirstName nvarchar(40)"
or numeric instead of numeric(2,2).

This parameters access columns declared with precision in my database
tables.

Has anyone tried this?
Gustavo De la Espriella
www.espriella.com
 
It's always a better idea to define the precision/scale in the stored proc.
If you are using OleDbCommandBuilder.DeriveParamaters you must declare them
else the values will be truncated. I don't think the DeriveParamaters method
has any way of knowing the precision/scale from the underlying table. Dot
Net is smart but not too smart!!!

Prodip
 
Back
Top