Traitée replacate a db to another

  • mercredi 18 janvier 2012 18:09
     
     

    Hi All I was looking for some tsql like

    restore database x to database y how do I use the eretore command to nightly copy one DBs content to the other?

Toutes les réponses

  • jeudi 19 janvier 2012 13:48
    Auteur de réponse
     
     

    Hello,

    It depends on what you mean by "copy".

    Do you want to completely overwrite the y database with the x database so it's an exact copy? Do you just want to update a specific table in y from x? Do they hold different sets of data but one or more tables should be kept in synch?

    -Sean

  • jeudi 26 janvier 2012 06:54
    Modérateur
     
     Traitée
    Hi rmerritt,

    Could you please elaborate on your scenario a bit more?

    To restore a database from a backup file, you can use RESTORE DATABASE command. In case of you are trying to restore an existing database which is in using, you may need to change it to the single user mode and rollback after completing. For more information: SQL SERVER – Restore Database Backup using SQL Script (T-SQL).

    Stephanie Lv

    TechNet Community Support