Options

Apparent problem w/DEFAULT constraints of NEWSEQUENTIALID()

jalbertjalbert Posts: 18
edited December 14, 2015 1:08PM in SQL Compare Previous Versions
When I try to synchronize this following scripted table:
CREATE TABLE foo
(
    foo_id UNIQUEIDENTIFIER CONSTRAINT default_foo_id DEFAULT NEWSEQUENTIALID() NOT NULL
);

I get the following error message:
The following error message was returned from the SQL Server:

[128] The name "NEWSEQUENTIALID" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.

The following SQL command caused the error:

CREATE TABLE [dbo].[foo]
(
[foo_id] [UNIQUEIDENTIFIER] NOT NULL CONSTRAINT [default_foo_id] DEFAULT ([NEWSEQUENTIALID]())
)

It would appear that SQL Compare 6.1 is escaping/qualifying the "NEWSEQUENTIALID" text instead of recognizing it as a built-in keyword. Its close relative NEWID() works correctly.

Is there a workaround? Thanks.

Comments

  • Options
    Hi there,

    It looks like that you have found a bug in the script comparison. I think the only workaround will be to search replace the string in the synchronisation script, sorry I know this isn't a perfect solution. I will double check with the developers and get back to you shortly about this.

    Regards,

    Jonathan
    Jonathan Watts

    -Project Manager
    -Red Gate Software Ltd
  • Options
    This is still an issue in version 6.2.
  • Options
    Unfortunately we were unable to resolve this in time for 6.2 which only contained limited bug fixes. It is in our bug tracking system currently slated for a 6.3 release. I have add a note to the report to update you regarding the status of this issue.

    Regards,

    Jonathan
    Jonathan Watts

    -Project Manager
    -Red Gate Software Ltd
  • Options
    KnoxBloxKnoxBlox Posts: 1 New member
    Was this ever corrected? I'm getting the same result in SQL Compare 11.4.

    The name "newsequentialid" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
    The database update failed
Sign In or Register to comment.