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  | 
                             
                            
                                    | 
                                         speno 
                                        Starting Member 
                                         
                                        
                                        18 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2005-08-30 : 16:38:12
                                            
  | 
                                             
                                            
                                            | I've inherited administration of a database from a previous owner on SQL 2000. The database has 2 primary mdf files and 2 log files. When I run a RESTORE FILELISTONLY, it shows 2 mdf files with different names as Primary and 2 log files with different names. How can I merge into 1 primary and 1 log? | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     Westley 
                                    Posting Yak  Master 
                                     
                                    
                                    229 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2005-08-30 : 22:40:14
                                          
  | 
                                         
                                        
                                          | Hi speno,  you can use DBCC SHRINKFILE (<filename>, EMPTYFILE ), this will empty your mdf file and put everything to 1, not too sure why you like to do that tho.  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     speno 
                                    Starting Member 
                                     
                                    
                                    18 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2005-08-31 : 11:58:36
                                          
  | 
                                         
                                        
                                          | Thanks for the tip. It's more of a clean up issue for me as I migrate this db to another server. Question I still have is once I ran the dbcc command and then backed up the db again, FILELISTONLY still shows the other mdf. Is that expected or how do I know that it's really not being used anymore?  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     MuadDBA 
                                      
                                     
                                    
                                    628 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2005-08-31 : 13:04:12
                                          
  | 
                                         
                                        
                                          | After you use the DBCC command, you have to use the ALTER DATABASE command to remove the empty file.  THEN it will only be using one file.  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |