I don't think performance is the main issue here - though, with string parameters (varchar), if you don't specify the length, ADO.NET runtime will set the maximum length of the parameter to the actual length, which may or may not be such a great idea .. ..
However: explicitly not specifying a data type with this statement:
SqlParameter p = new SqlParameter("@DatabaseId", Quarter.DataBaseId);
has a potentially big problem with which the ADO.NET runtime should guess which data type you want to use. This is a very good job - most of the time. But how should it guess the data type if you specify a NULL value? Or if you bet 50 is INT ? SmallInt ? TinyInt ? BigInt ?
Directly specifying the SqlParameter type can lead to unwanted (and undesirable) conversions, which can cost performance. But even worse: it can lead to direct errors, because if the guessing of the ADO.NET runtime is turned off, you may encounter errors at runtime (for example, when it cannot correctly assume that something is DATETIME or such) .
source share