Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

safely remove rowguid column? Expand / Collapse
Author
Message
Posted Thursday, August 30, 2012 5:16 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, December 16, 2014 8:55 PM
Points: 1,076, Visits: 3,054
Hi,

Recently database was migrated to SQL 2K8R2 from SQL 2K.
Already configured replication in SQL2K, replication was removed in SQL 2K after that database migrated to new SQL 2K8R2 setup.

I am planed to configure database mirroring instead of using replication

I want to remove rowguid column for all tables. Is there issue will come after droping rowguid column, Please suggestion me.

I have tried as blow command, but it is not hope.

alter table dbo.user_services drop column rowguid

Msg 5074, Level 16, State 1, Line 1
The object 'DF__sequences__rowgu__640DD89F' is dependent on column 'rowguid'.
Msg 5074, Level 16, State 1, Line 1
The index 'index_53575229' is dependent on column 'rowguid'.
Msg 4922, Level 16, State 9, Line 1
ALTER TABLE DROP COLUMN rowguid failed because one or more objects access this column.


In this cause first remove all rowguid default constraints, and drop rowguid indexes after that drop rowguid column all tables, is it correct?
Post #1352115
Posted Monday, September 3, 2012 8:26 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, December 2, 2014 8:16 AM
Points: 1,618, Visits: 1,554
It depends. There is no way for us to say whether those rowguid columns serve a function other than replication. If there is already a rowguid column on a table, merge replication will use the existing column rather than create a new one.

Additionally, if code has not been written carefully, you may have code that is doing "Select *" and expects all columns to be there even if it doesn't use them. so removing the column can cause bad code to break.

You should involve your engineering team, and it should be thoroughly tested in pre-production before you do it in production.




My blog: SQL Soldier
Twitter: @SQLSoldier
My book: Pro SQL Server 2008 Mirroring
Microsoft Certified Master: SQL Server 2008
Principal DBA: Outerwall, Inc.
Also available for consulting: SQL DBA Master
Post #1353551
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse