Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        
            
                
                    
                        
                            
                                | Author | 
                                
                                 Topic  | 
                             
                            
                                    | 
                                         csaha 
                                        Yak Posting Veteran 
                                         
                                        
                                        52 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2012-08-30 : 12:15:46
                                            
  | 
                                             
                                            
                                            | Used the following method to drop distribution database use master go alter database distribution set offline; drop database distribution;use mastergoalter database distribution set offline;drop database distribution;I no longer have distribution database listed in the system databases. However when I try to create a distribution database, rt click on the replication, cannot configure distribution database, but it is showing Distributor Properties. Also in Microsoft SQL Server folder Data distribution database is existing also the distribution database jobs are existing. Please advice how I can delete distribution database. | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     tkizer 
                                    Almighty SQL Goddess 
                                     
                                    
                                    38200 Posts  | 
                                    
                                      
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     prett 
                                    Posting Yak  Master 
                                     
                                    
                                    212 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2012-08-30 : 23:55:32
                                          
  | 
                                         
                                        
                                          | Check this article, it will help you drop distribution database: http://weblogs.sqlteam.com/tarad/archive/2009/09/02/How-to-remove-a-SQL-Server-distribution-database-if-other.aspx  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     tkizer 
                                    Almighty SQL Goddess 
                                     
                                    
                                    38200 Posts  | 
                                    
                                      
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     csaha 
                                    Yak Posting Veteran 
                                     
                                    
                                    52 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2012-08-31 : 09:23:42
                                          
  | 
                                         
                                        
                                          | Yes, I ran the above query and I cannot clean up the distribution database. Does that mean that I have to install sqlserver again? Due to lack of knowledge I deleted publisher and Subscriber, instead of running Disable Publishing and Distribution.  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     tkizer 
                                    Almighty SQL Goddess 
                                     
                                    
                                    38200 Posts  | 
                                    
                                      
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     csaha 
                                    Yak Posting Veteran 
                                     
                                    
                                    52 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2012-09-05 : 09:57:49
                                          
  | 
                                         
                                        
                                          | Since the datafile was existing in the datafolder I was able to attach the distribution database using the following command:CREATE DATABASE [distribution] ON ( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\distribution.mdf'),  ( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\distribution.ldf')FOR ATTACHGOselect * from msdb.dbo.MSdistpublishersdelete from msdb.dbo.MSdistpublisherssp_removedbreplication  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     tkizer 
                                    Almighty SQL Goddess 
                                     
                                    
                                    38200 Posts  | 
                                    
                                      
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |