Ver Mensaje Individual
  #26 (permalink)  
Antiguo 18/09/2012, 11:13
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 18 años, 3 meses
Puntos: 774
Respuesta: Importar Bases de datos automaticamente

http://msdn.microsoft.com/es-es/library/ms187495.aspx

revisa y dime que te falta:

Código SQL:
Ver original
  1. USE master;
  2. --Create tail-log backup.
  3. BACKUP LOG AdventureWorks2012
  4. TO DISK = 'Z:\SQLServerBackups\AdventureWorksFullRM.bak'  
  5.    WITH NORECOVERY;
  6. GO
  7. --Restore the full database backup (from backup set 1).
  8. RESTORE DATABASE AdventureWorks2012
  9.   FROM DISK = 'Z:\SQLServerBackups\AdventureWorksFullRM.bak'
  10.   WITH FILE=1,
  11.     NORECOVERY;
  12.  
  13. --Restore the regular log backup (from backup set 2).
  14. RESTORE LOG AdventureWorks2012
  15.   FROM DISK = 'Z:\SQLServerBackups\AdventureWorksFullRM.bak'
  16.   WITH FILE=2,
  17.     NORECOVERY;
  18.  
  19. --Restore the tail-log backup (from backup set 3).
  20. RESTORE LOG AdventureWorks2012
  21.   FROM DISK = 'Z:\SQLServerBackups\AdventureWorksFullRM.bak'
  22.   WITH FILE=3,
  23.     NORECOVERY;
  24. GO
  25. --recover the database:
  26. RESTORE DATABASE AdventureWorks2012 WITH RECOVERY;
  27. GO

saludos!
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me