30 July 2016

Fill Data To a Different Table Database

Sometimes we have to be able to fill the data in a different database tables. For example, the data in the table in the database that is now being used accidentally deleted, this is one of the terrible things that could happen to a programmer, to overcome it we can use the database backup to restore the data, although not all data can be restored , but a minimum of 90% or 95% of the data can be restored if we have a database backup, but otherwise it would be difficult to overcome, or even can not be at all: D. 

To fill the data in different tables database in Sql Server 2008, code is essentially as follows: 

Insert Into [database name]. [Dbo]. [Table Name] 
Select * From [database name]. [Dbo]. [ The table name] 

Example: 
Insert Into RunningDatabase.dbo.Patient 
Select * From BackupDatabase.dbo.Patient

No comments:

Post a Comment

Pengumuman