I have a uniqueidentifier column in a table and it's not a key or index. I want to set the default value using NEWSEQUENTIALID(), but I get the error:
Error validating default for column..
But if I use NEWID() no error. What's going on?
I have a uniqueidentifier column in a table and it's not a key or index. I want to set the default value using NEWSEQUENTIALID(), but I get the error:
Error validating default for column..
But if I use NEWID() no error. What's going on?
Hi, according to the documentation: http://msdn.microsoft.com/en-us/library/ms189786.aspx Remarks section:
... When NEWSEQUENTIALID() is used in DEFAULT expressions, it cannot be combined with other scalar operators. For example, you cannot execute the following:
CREATE TABLE myTable (ColumnA uniqueidentifier DEFAULT dbo.myfunction(NEWSEQUENTIALID())) ...
Does that answer your question?
This is a bug in the designer that is not being fixed by microsoft.
http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/cad8a4d7-714f-44a2-adb0-569655ac66e6