Open GoogleCodeExporter opened 9 years ago
sp_rename does not support renaming ROWGUIDCOL. We would need to change the
entire
column rename strategy of SQL Server to support this. That still might not work?
Original comment by geoffl...@gmail.com
on 4 Aug 2008 at 11:25
What we've done in our project is just drop the ROWGUIDCOL and re-add it.
I'm not sure how this will affect any replication publications or subscriptions
that
you have, but it worked fine for me.
Original comment by subdigi...@gmail.com
on 27 Oct 2008 at 5:11
No @subdigital, dropping and re-adding it doesn't seem like a practical
solution when
dealing with a primary key that is related to many tables in huge databases. To
solve
your issue srikanth:
- Fire SQL 2005 management studio and open table in "design" view
- Highlight the column and go to Properties window
- Go to "RowGuid" property and set it to "No"
- Save the table
- Reopen in "design" view
- Rename column
- Set "RowGuid" back to "Yes"
- Save the table
Voila!
Original comment by nicholas...@gmail.com
on 14 Jan 2010 at 9:40
To apply nicholas.credli's method directly to Migrator.NET, surround the
Database.RenameColumn call with the following calls:
Database["SqlServer"].ExecuteNonQuery("ALTER TABLE tableName ALTER COLUMN
oldColumnName DROP ROWGUIDCOL");
Database.RenameColumn("tableName", "oldColumnName", "newColumnName");
Database["SqlServer"].ExecuteNonQuery("ALTER TABLE tableName ALTER COLUMN
newColumnName ADD ROWGUIDCOL");
Original comment by matthias...@googlemail.com
on 10 Feb 2010 at 6:00
In general case, you should also take into account foreign keys, that can use
the
column.
Original comment by dima117a@gmail.com
on 11 Feb 2010 at 5:49
Original issue reported on code.google.com by
srikanth...@gmail.com
on 2 Jul 2008 at 6:44