SqlServer SMO StoredProcedureParameter Bug?

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 =newStringBuilder("@");

parameterBuilder.Append(column.Name);

sp.Parameters.Add(newStoredProcedureParameter(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

[2044 byte] By [DougHolland] at [2008-2-22]
# 1

This is a know issue in SMO, which is expected to be in Service Pack 1.

Peter

PeterSaddowMSFT at 2007-10-7 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...
# 2

Any idea when we might see SP1?

Q1 2006 maybe or do you think later than that?

Thanks in advance

Doug

DougHolland at 2007-10-7 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...
# 3

It is going to be more likely Q2.

Peter

PeterSaddowMSFT at 2007-10-7 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...

SQL Server

Site Classified