Ignore ROWGUID/ROWGUIDCOL columns

bluebird84bluebird84 Posts: 10 New member
Hi,

I'm comparing our non-replicated Development database with our replicated UAT Database - using the compare I'd like to update the schema of the Replicated Database (new columns, new tables, new and altered stored procedures etc).

The issue I'm having is that the ROWGUID columns in the Development database are set to NEWID() and in UAT they have been changed by Replication to NEWSEQUENTIALID(). Therefore the comparison is pretty useless as it shows a difference in all tables.

Does anyone have a way around this, apart from manually editing the scripts generated? A way of ignoring the ROWGUIDCOL columns maybe? ('unmapping' the rowguid from each table)?

many thanks

Comments

  • bluebird84bluebird84 Posts: 10 New member
    I think I may have figured out a fix to my original problem. My idea was to change the rowguid default value in Dev to newsequentialID so it matched the replicated database but I think I needed to drop the original and create a new one instead.

    I wasn't getting the order of the constraints or ALTER table statements correct which was causing the column creation to fail, but I think I've got the order correct now.

    drop the newID() rowguid
    ALTER TABLE dbo.[table1] ADD rowguid uniqueidentifier
    ALTER TABLE [dbo].[table1] ADD CONSTRAINT [DF_table1_rowguid] DEFAULT (newsequentialid()) FOR [rowguid]
    ALTER TABLE dbo.[table1] ALTER COLUMN rowguid uniqueidentifier NOT NULL
    ALTER TABLE dbo.[table1] ALTER COLUMN rowguid ADD ROWGUIDCOL
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Thanks for letting us know that you have a workaround. This is one of many issues that come up because SQL Compare is not replication-aware.
Sign In or Register to comment.