In Real-time Geodatabase Replication? Part 1 you were introduced to SQL Real-Time Replication. One requirement of SQL Merge Replication is that the table being replicated must have a rowguidcol. This is easy with a cursor:
DECLARE @sql VARCHAR(500), @tableName VARCHAR(128) DECLARE gandgCursor CURSOR FOR SELECT table_name FROM SDE_column_registry WHERE table_name like 'CR%' ORDER BY table_name ASC OPEN gandgCursor FETCH NEXT FROM gandgCursor INTO @tableName WHILE ( @@FETCH_STATUS = 0 ) BEGIN SET @sql = ' ALTER TABLE [dbo].['+ @tableName + '] ALTER COLUMN GlobalID ADD ROWGUIDCOL ; ' PRINT 'Executing Statement - '+ @sql EXECUTE ( @sql ) FETCH NEXT FROM gandgCursor INTO @tableName END CLOSE gandgCursor DEALLOCATE gandgCursor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.