I was starting to configure replication on SQL Server database. I created a distributor with the following command:
exec sp_adddistributiondb @database = N'prod_database',
@data_folder = N'D:\Data', @log_folder = N'L:\Logs',
@log_file_size = 2, @min_distretention = 0,
@max_distretention = 72, @history_retention = 48,
@deletebatchsize_xact = 5000, @deletebatchsize_cmd = 2000,
@security_mode = 1
I have a database prod_database with the same name as the distributor I created.
I am trying to delete the distributor with:
exec sp_dropdistributor @no_checks = 1, @ignore_distributor = 1
I am getting the following error:
Msg 21122, Level 16, State 1, Procedure sys.sp_dropdistributiondb, Line 125 [Batch Start Line 0]
Cannot drop the distribution database 'prod_database' because it is currently in use.
It is a production environment.
I am using Microsoft SQL Server Management Studio and now this database is shown on System Database folder.
I want to delete the distributor created.
masterdistributiontag does not mean what you appear to think it does. Please read tag descriptors before using the tag.