Adding uniqueidentifier in Merge Replication | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Adding uniqueidentifier in Merge Replication

Hello, Can someone provide me script to add this column in a table? Thank you. -Nilay
Use ALTER TABLE… statement to add uniqueidentifierand set NOT FOR REPLICATION option to the IDENTITY column. _________
Satya SKJ
Moderator
SQL-Server-Performance.Com

This script should be ok? Alter table [dbo].[Client] add rowguid uniqueidentifier ROWGUIDCOL default newid() not null UPDATE [dbo].[Client] SET [rowguid] = DEFAULT -Nilay
yep looks right to me, you won’t need the update since the alter table already has a default Cheers
Twan
Yes, and you can check it yourself by parsing the query using QA (just in case). _________
Satya SKJ
Moderator
SQL-Server-Performance.Com

I think I forgot here that we need to put index on that column.

yep you will need a unique index on the column… create unique index iux_client_rowguid on dbo.client ( rowguid ) Cheers
Twan
]]>