Jota (kangona8 (AT) hotmail (DOT) com) writes:
Quote:
How can I backup multiple databases with the command OSQL from one
instance, creating one backup file for each database? Is it possible? If
not how can I acomplishe this? Wich command should I use? |
The command you would use would obviously be BACKUP, and you would
need one command per database.
But you don't have to list all databases, but you could run a cursor over
sys.databases (or sysdatabases if you are on SQL 2000.) Note that you don't
necessarily have to use dynamic SQL to create the BACKUP commands,
as BACKUP accepts variables for many of its parameters.
--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx