Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to rename some tables in my DB - SQL Server 2005, with this:

EXEC sp_rename 'dbo.TableName', 'Tmp_TableName', 'OBJECT'

but I can't do this - I get this exception -

Cannot rename the table because it is published for replication

This DB doesn't have replication - it was removed 5 years ago - we've just tried it and removed it after a week. So I suppose that it should be a flag somewhere.

Please help me remove this flag somehow.

share|improve this question
sp_removedbreplication 'DB_NAME' that will remove replication from the database + check this out on how to manually remove replication and… – Kin Jul 29 '13 at 16:14
Thank you so much, Kin !!! sp_removedbreplication helped ! – hotfusion Jul 29 '13 at 17:17
Glad it helped. I have put it as an answer. Please upvote/mark as answer. – Kin Jul 29 '13 at 17:20
up vote 6 down vote accepted

sp_removedbreplication 'DB_NAME' that will remove replication from the database.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.