SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


safely remove rowguid column?


safely remove rowguid column?

Author
Message
SQL Galaxy
SQL Galaxy
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2500 Visits: 3465
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?
Robert Davis
Robert Davis
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2736 Visits: 1623
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 MVP
Database Engineer at BlueMountain Capital Management
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search