Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to drop table in replication?
Message
From
31/10/2007 09:08:56
 
General information
Forum:
Microsoft SQL Server
Category:
Replication
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01265087
Message ID:
01265331
Views:
8
Hi Zoran,

Thanks for the instruction. Where do I get the two store procedures that you have mentioned below? Please advise.

Thanks,
Sam

>>I am trying to drop this table, but I keep getting this error. How do I delete this table? Please help.
>>
>>
>>if exists (select * from dbo.sysobjects where id = object_id(N'[my_table_name]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
>>drop table [my_table_name]
>>GO
>>
>>Server: Msg 3724, Level 16, State 2, Line 2
>>Cannot drop the table 'my_table_name' because it is being used for replication.
>>
>>
>>Thanks,
>>Sam
>
>
>Samuel,
>
>You have to remove it from the publication first!
>
>Please find example below:
>
>
>exec sp_dropsubscription
> @publication = N'MyPublication',
> @article = N'MyTableName',
> @subscriber = N'all',
> @destination_db = N'all'
>GO
>exec sp_droparticle
> @publication = N'MyPublication',
> @article = N'MyTableName',
> @force_invalidate_snapshot = 1
>GO
>
>-- AND NOW YOU CAN DROP THE TABLE !
>DROP TABLE MyTableName
>GO
>
>--hope this helps
>
>--Cheers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform