I'm creating a Windows Forms application which auto-generates my stored procedures for me.
Based upon a column's DataType property I'm creating instances of StoredProcedureParameter as below:
if
(column.InPrimaryKey) {StringBuilder parameterBuilder = new StringBuilder("@");
parameterBuilder.Append(column.Name);
sp.Parameters.Add(new StoredProcedureParameter(sp, parameterBuilder.ToString(), column.DataType));
Unfortunately when the columns datatype is nvarchar(max) the stored procedure is created with the following erronous parameter declaration
@SettingValue [nvarchar](100),@SettingDescription [nvarchar]
,@SettingCategory [nvarchar]
(50),Notice how the SettingValue and SettingCategory parameters correctly specify the size as 100 and 50 respectfully. SettingDescription is defined in the table design as an nvarchar(max). However SMO creates it as a single character nvarchar.
Thanks in advance
Doug Holland

SqlServer SMO StoredProcedureParameter Bug?
EvanY
This is a know issue in SMO, which is expected to be in Service Pack 1.
Peter
Devendersys
It is going to be more likely Q2.
Peter
Sillyman
Any idea when we might see SP1
Q1 2006 maybe or do you think later than that
Thanks in advance
Doug