I am using a SQL Project in Visual Studio (SSDT) and I have a column defined as:
BinaryDocument VARBINARY(MAX) FILESTREAM NOT NULL
I need to make a change to allow NULL, so I changed the definition to:
BinaryDocument VARBINARY(MAX) FILESTREAM NULL
But when publish the project, the script generated shows:
ALTER TABLE [Docs] ALTER COLUMN [BinaryDocument] VARBINARY (MAX) NULL;
Which, as you would expect because you can't remove FILESTREAM from a column, gives the following error:
Cannot alter column 'BinaryDocument' in table 'Docs' to add or remove the FILESTREAM column attribute.
Does anyone know if this is supposed to work or is it just me? Is there any workaround?
EDIT
It's not just restricted to making NULLable. Tried setting a default and same problem:
BinaryDocument VARBINARY(MAX) FILESTREAM NOT NULL DEFAULT(0x00)
Yields the same output in the publish script as above:
ALTER TABLE [Docs] ALTER COLUMN [BinaryDocument] VARBINARY (MAX) NOT NULL;
So it seems to honour the NULL/NOT NULL changes, but fails to carry the FILESTREAM keyword into the output script :(