![]() |
|

| Answered 2/7/2012 10:48:45 AM by Ray Barley |
(0)
|
|
Take a look at this tip: http://www.mssqltips.com/sqlservertip/1070/simple-script-to-backup-all-sql-server-databases/
|
|
| Answered 2/9/2012 6:17:16 AM by Ray Barley |
(0)
|
|
You can take the script in the tip: http://www.mssqltips.com/sqlservertip/1070/simple-script-to-backup-all-sql-server-databases/ and change it; e.g. create a temp table, insert each backup command into the temp table, then select everything from the temp table after the cursor is done. |
|
| Answered 2/9/2012 1:37:06 PM by Jeremy Kadlec |
(0)
|
|
Pinkett, I assume you are looking for a command like this: BACKUP DATABASE [Test1] TO DISK = 'C:\Temp\Backup\Test1_20120209.BAK' WITH INIT Here is the code I used to generate it:
SET @path = 'C:\Temp\Backup\'
DECLARE db_cursor CURSOR FOR OPEN db_cursor WHILE @@FETCH_STATUS = 0 FETCH NEXT FROM db_cursor INTO @name CLOSE db_cursor
The original code is from this tip - http://www.mssqltips.com/sqlservertip/1070/simple-script-to-backup-all-sql-server-databases/. Let me know if this is what you are looking for. Thank you,
|
|
|
privacy | disclaimer | copyright | advertise | about authors | contribute | feedback | giveaways | user groups Some names and products listed are the registered trademarks of their respective owners. Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com |