Newsequentialid error validating default
For this type of guid, 47 bytes are the MAC address, 16 are clock cycle, and 60 bits are the time since 15 October 1582 in 100 nanosecond increments.If you're curious you can check out Section 4.2 of RFC 4122.
It cannot be combined with other operators to form a complex scalar expression), and abort the transaction.No one seems to understand why this restriction is in place, and why we have to resort to using temporary table just to acquire a new sequential id.Limiting it to default values and not allowing it to participate in expressions is just absurd.Running this in ssms results in squential guids: insert into Table_1 (Name) values('test13a'); insert into Table_1 (Name) values('test14a'); insert into Table_1 (Name) values('test15a'); insert into Table_1 (Name) values('test16a'); insert into Table_1 (Name) values('test17a'); It's a bad function name.The GUIDs aren't sequential, rather they are monotonically increasing.The tracking defect on Connect (https://connect.microsoft.com/SQLServer/feedback/details/472092/newsequentialid-bug-in-management-studio) keeps receiving complains about the observed, undesired behavior. However, if you don’t just set the expression “right”, you still get the error.
And people typically still hits this problem, even with the fix.
The most common reason for this is that the default value does not conform to the column's data type.
For example, if you enter a letter as the default value of a column whose data type is bit, you will encounter this error.
So, no parenthesis surrounding the expression, spaces between the parenthesis used by the builtin, or anything like that.
The text of the Default Value property is inconsistent with one or more of the column's settings.
When you have a GUID column as a row identifier, you could create a DEFAULT constraint that uses the NEWSEQUENTIALID() function.