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 |  
                                    | Swati JainPosting Yak  Master
 
 
                                        139 Posts | 
                                            
                                            |  Posted - 2008-01-08 : 06:50:52 
 |  
                                            | Hi,I have taken backup of database . and creatd the similar database.Now i have clean the new databse.I want to import the data from tables of first database(database before backup) to to tables of new database(Backup database)I dont want to write the insert statement for every table for inserting data from same table of original database.Is there any  quick workaround  for this? |  |  
                                    | madhivananPremature Yak Congratulator
 
 
                                    22864 Posts | 
                                        
                                          |  Posted - 2008-01-08 : 07:42:13 
 |  
                                          | Restore the databaseMadhivananFailing to plan is Planning to fail |  
                                          |  |  |  
                                    | Swati JainPosting Yak  Master
 
 
                                    139 Posts | 
                                        
                                          |  Posted - 2008-01-08 : 08:39:07 
 |  
                                          | quote:Hi Madhivanan,Actualy I want to not restore whole database,But I want to get data from some tablesOriginally posted by madhivanan
 Restore the databaseMadhivananFailing to plan is Planning to fail
 
 |  
                                          |  |  |  
                                    | madhivananPremature Yak Congratulator
 
 
                                    22864 Posts | 
                                        
                                          |  Posted - 2008-01-08 : 08:45:26 
 |  
                                          | Use this methodInsert into newdb.dbo.table(columns)select columns from olddb.dbo.tableMadhivananFailing to plan is Planning to fail |  
                                          |  |  |  
                                    | Swati JainPosting Yak  Master
 
 
                                    139 Posts | 
                                        
                                          |  Posted - 2008-01-08 : 09:37:04 
 |  
                                          | quote:Is there no other method to do this  . bcoz i hv n number of tables having n number of columns . so doing this thing  everytime is realy cumbersomeOriginally posted by madhivanan
 Use this methodInsert into newdb.dbo.table(columns)select columns from olddb.dbo.tableMadhivananFailing to plan is Planning to fail
 
 |  
                                          |  |  |  
                                    | madhivananPremature Yak Congratulator
 
 
                                    22864 Posts | 
                                        
                                          |  Posted - 2008-01-09 : 03:13:10 
 |  
                                          | Run thisselect 'insert into newdb.dbo.'+name +' select * from olddb.dbo.'+name from sysobjectswhere xtype='u'Copy the result back to QA and run one by oneMadhivananFailing to plan is Planning to fail |  
                                          |  |  |  
                                |  |  |  |