Removing Distribution From Sql Server


Hello all,
Today we learn how to remove distribution database from your sql server.
Dont try to delete the distribution server directly. If you delete the distribution database, its actually not deleted, then you have to reinstall the sql server. So, to avoid this mess up please copy the following script and run in your sql server…

decalre @removeDist nvarchar(1000)
set @removeDist = 'use master
if exists(select * from sys.databases where name = ''distribution'')
exec sp_dropsubscriber @subscriber = N''hasib\sql2008'', @reserved = N''drop_subscription''
if exists(select * from sys.databases where name = ''distribution'')
exec sp_dropdistribution @no_checks = 1
'
exec(@removeDist)

Thats it.
If you have any query please comments the post. I will response asap.
Take care.

Bye…

Leave a comment