Adding a column with DataType VarBinaryMax using SMO

24 August, 2006 (00:48) | .net

I have discovered that the following code does not behave as expected…
Table someTable = database.Tables["some_table"];
Column someColumn = new Column (someTable, "some_column", DataType.VarBinaryMax);
someTable.Columns.Add(someColumn);
someTable.Alter();

This code will actually add a column of type varbinary(1) to the database. The following works…
Column someColumn = new Column (someTable, "some_column", DataType.VarBinary(-1));
Oh well.

Comments

Comment from Adam
Date: November 14, 2007, 1:07 am

This seems to have been picked up by Microsoft and fixed:

http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=233992

Write a comment