Pasar una BD de una pc a otra


/ Published in: SQL
Save to your folder(s)

Pasar una BD de una pc a otra


Copy this code and paste it in your HTML
  1. RESTORE FILELISTONLY
  2. FROM DISK = 'C:\bdEuroidiomas.BAK'
  3.  
  4. IF EXISTS(SELECT NAME FROM SYSDATABASES
  5. WHERE NAME = 'bdEuroidiomas')
  6. BEGIN
  7. DROP DATABASE bdEuroidiomas;
  8. END
  9. GO
  10.  
  11. RESTORE DATABASE BDEuroidiomas
  12. FROM DISK = 'C:\bdEuroidiomas.bak'
  13. WITH RECOVERY,
  14. MOVE 'euroidiomas_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\bdEuroidiomas.mdf',
  15. MOVE 'euroidiomas_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\bdEuroidiomas_log.ldf'
  16. GO

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.