Msg 302, Level 16, State 0, Line 3
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 occurs when we try to use the NEWSEQUENTIALID() function in the SQL statements or in SET statements. e.g.
SELECT NEWSEQUENTIALID()
OR
declare @varunique UNIQUEIDENTIFIER
SET @varunique=NEWSEQUENTIALID()
SELECT @varunique
OR
INSERT INTO AA(id, name) VALUES(NEWSEQUENTIALID(),'abc')
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.
Showing posts with label SQL Server Errors. Show all posts
Showing posts with label SQL Server Errors. Show all posts
Thursday, March 10, 2011
Friday, December 3, 2010
Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created.
When making changes in a table, an error might occur
Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.
The reason behind this error is that, whenever we add or delete a field of a table, that table requires to be dropped and recreate again. SQL Server prevents this change to happen ie it does not allow for drop and recreate of the table.
Here is solution to this problem
Open the SQL Server Management Studio
Go to the Tools Menu and select Options
Subscribe to:
Posts (Atom)
