﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Wesley Brown / Article Discussions / Article Discussions by Author  / Stored Procedure to Backup all Databases / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 18:36:42 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Stored Procedure to Backup all Databases</title><link>http://www.sqlservercentral.com/Forums/Topic402749-195-1.aspx</link><description>I am also having a small script to backup all my databases.....Use MasterDECLARE @name VARCHAR(50) -- database name DECLARE @path VARCHAR(256) -- path for backup files DECLARE @fileName NVARCHAR(256) -- filename for backup DECLARE @fileDate VARCHAR(20) -- used for file nameSET @path = 'd:\Backup\' SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)SELECT name,flag=0 into #tempbackup FROM master.dbo.sysdatabases WHERE name NOT IN ('master','model','msdb','tempdb')set rowcount 1WHILE (exists(SELECT * FROM #tempbackup WHERE flag=0)) BEGIN     Select @name=name from #tempbackup WHERE flag=0       SET @fileName = @path + @name + '_' + @fileDate + '.BAK'        print @fileName       BACKUP DATABASE @name TO DISK = @fileName               Update #tempbackup set flag=1 WHERE flag=0 and name=@name END  set rowcount 0drop table #tempbackup</description><pubDate>Thu, 18 Jun 2009 23:50:39 GMT</pubDate><dc:creator>Manish_</dc:creator></item><item><title>Stored Procedure to Backup all Databases</title><link>http://www.sqlservercentral.com/Forums/Topic402749-195-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Backup+%2f+Restore/30066/"&gt;Stored Procedure to Backup all Databases&lt;/A&gt;[/B]</description><pubDate>Tue, 25 Sep 2007 14:38:50 GMT</pubDate><dc:creator>Wesley Brown</dc:creator></item></channel></rss>