Friday, March 9, 2012

NEWSEQUENTIALID()

I'm trying to modify my default value for GUIDs in DB, currently using newid() for default.

In management studio, click on modify and in the table designer for the default value I entered newsequentialid() and got the following error.

Error validating the default for column "xxxx".

I would like to have my tables that are using guids, have newsequentialid as the default value. When read on this new function it says can only be used with default value, but can't get that to work. Any ideas?

thanks

This is a bug in Management Studio. There are two workarounds

1. Create the table by hand in T-SQL.

2. Use newid, then generate a script, and replace the newid with newsequential.

You can file a bug at http://lab.msdn.microsoft.com/productfeedback/

|||I can set the default value OK in management studio if it is a brand new table. I'm trying to upgrade my tables in my DB to have the default to be newsequentialId(). Is there a problem if there is already data in the tables with now changing from newid() to newsequentialid()|||

Why on earth is this not fixed yet AND there doesn't seem to be any official Microsoft posting or commment regarding this?

Seriously annoying bug.

|||

If we cannot answer a question in the forums in the first month, it generally gets ignored and we do not go back and try to answer it later. Whenever there is a problem with our product, I strongly recommend filing a bug or a suggestion in Microsoft Connect.

SQL Server's portal on Microsoft Connect: http://connect.microsoft.com/SQLServer/

Paul A. Mestemaker II
Program Manager
Microsoft SQL Server Manageability
http://blogs.msdn.com/sqlrem/

No comments:

Post a Comment