I'm in the middle of implementing the FILESTREAM feature of SQL 2008 for storing BLOB data.
In order to implement (according to FILESTREAM requirements), you MUST include a column in your table (the table that has the BLOB data) that is of:
"uniqueidentifier rowguidcol" type
The column MUST also be marked as NOT NULL.
The column MUST also be marked as UNIQUE.
I had wanted to take advantage of OpenAccess' new "default value" ability. I wanted to use a default value in SQL of "newsequentialid()" for the column above.
Putting all that together, the script for the column would look like this:
[FSRowGuid] [uniqueidentifier] rowguidcol
Can anybody tell what issues there will be?
Let's look at it from the ORM/OA side first...
In order to use OA's default value, the field MUST BE marked as NULL. This is in clear violoation of the FILESTREAM requirement of the column being marked as NOT NULL. Given I NEED to use FILESTREAM, I guess my hopes of using OA's default value ability is out the window huh?
Now... from the .NET perspective...
Ok, so... I can't use OA's default value ability. I'll just add that field value in code like I've done for years because of the OA's inability to have default values (up until now)...right? WRONG. .NET doesn't have any equivilent for "newsequentialid()" to be able to add the value manually.
So, not only can I not use OA's default values, I can't use SQL's sequencialids either. Great.
Now I need to take that part out and go back to creating standard GUID values and manually inserting them with other data.
Is this just sorta what we have to put up with?
Or, is there a better answer that I'm not seeing?