Msg 302, Level 16, State 0, Line 1
The newsequentialid() built-in function can only be used in a DEFAULT expression for a column of type ‘uniqueidentifier’ in a CREATE TABLE or ALTER TABLE statement. It cannot be combined with other operators to form a complex scalar expression.
This error message appears when you try to call the newsequentialid() function outside the scope of a DEFAULT expression for a column.
The T-SQL statement can be parsed, but causes the error at runtime.
Errors of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. Newsequentialid() can only be used within a DEFAULT expression of a column.
This error message was introduced with SQL Server 2005.
In the above example we try to use the NEWSEQUENTIALID() function in a SELECT statement. This raises the error.