September 2, 2014 at 6:16 am
The error message is "cannot drop the table because it is being used for replication"
my sql version is in sql server 2012 and Im ussing merge replication.
I want to drop only one table
I highly appreciate your quick response.
September 2, 2014 at 6:34 am
Remove the table from the publication, then drop it.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 2, 2014 at 6:37 am
Have a look at this thread:- http://www.dbtalk.net/microsoft-public-sqlserver-replication/orphaned-entries-sys-objects-after-286901.html
It mentions using the following procedure after the table has been removed from replication:-
EXEC sp_MSunmarkreplinfo 'YOUR TABLE NAME';
GO
September 2, 2014 at 6:40 am
Thanks for quick response.
This table already dropped from the publication
I think this table did not dropped clearly.
September 2, 2014 at 6:43 am
This is not working for 2012
Do you know any sp for 2012
September 2, 2014 at 6:56 am
Are you still getting the same error once the table was removed from replication and the stored procedure executed?
September 2, 2014 at 7:05 am
yes
September 2, 2014 at 1:36 pm
Drop its subscription and article and re-run snapshot:
exec <your_db>.dbo.sp_dropsubscription
@publication = <publication_name>,
@article = <article_name>,
@subscriber = 'all',
@destination_db = 'all'
go
exec <your_db>.dbo.sp_droparticle
@publication = <publication_name>,
@article = <article_name>,
@force_invalidate_snapshot = 1
go
exec msdb.dbo.sp_start_job 'repl_snapshot_job_name'
go
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply