﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by jack  / Backup on the fly based on previous backups / 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 20:07:57 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Backup on the fly based on previous backups</title><link>http://www.sqlservercentral.com/Forums/Topic659975-1488-1.aspx</link><description>you got some special characters in there somehow.  try pasting it into notepad first and remove the "boxes"  -Jack</description><pubDate>Wed, 24 Feb 2010 10:12:57 GMT</pubDate><dc:creator>jack-311987</dc:creator></item><item><title>RE: Backup on the fly based on previous backups</title><link>http://www.sqlservercentral.com/Forums/Topic659975-1488-1.aspx</link><description>This Code Same iam Paste in Sqlserver2005 Backup on the fly based on previous backups But Iam Getting Errordeclare @Physical_device_name nvarchar(500)declare @backup_path nvarchar(500)declare @i intdeclare @backup_command nvarchar(1000)declare @date_string nvarchar(100)select top 1@Physical_device_name = bumf.physical_device_namefrom master.dbo.sysdatabases sysdbleft join (select database_name, max(backup_set_id) maxbusidfrom msdb..backupset where type = 'D' and @@servername like '%' + machine_name + '%' --- server has instance, machineand media_set_id in (select media_set_id from msdb.dbo.backupmediafamily where device_type in (2,102) )group by database_name) maxbuson maxbus.database_name = sysdb.namejoin msdb..backupset bus on bus.backup_set_id = maxbus.maxbusidjoin msdb.dbo.backupmediafamily bumf on bumf.media_set_id = bus.media_set_idand bumf.device_type in (2,102) -- diskwhere sysdb.name =db_name()order by bus.backup_finish_date descif @Physical_device_name IS NOT NULL        BEGIN     --tells you where to cut it off, grabs the last slash        select @i = charindex('\', reverse(@Physical_device_name) )    	--now just get the path before the last slash                select @backup_path = left(@Physical_device_name, len(@Physical_device_name)-@i)            select @date_string = replace(replace(replace(convert(varchar(16),getdate(),120),':',''),space(1),space(0)),'-',space(0))        set @backup_command = 'backup database ' + db_name() + ' to disk=' + char(39) + @backup_path +'\' + db_name() + '_diff_' + @date_string + '.bak' + char(39) + ' with differential'                 print @backup_command            exec(@backup_command)     END ELSE     BEGIN        raiserror('Cannot determine backup directory',16,1)    END    end    HI Friends  iam geting Error In IF Condition Place :Please Tell me :[b]Msg 102, Level 15, State 1, Line 32Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 37Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 40Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 43Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 44Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 49Incorrect syntax near ' '.Msg 102, Level 15, State 1, Line 53Incorrect syntax near ' '.[/b]please give me ReplyI want urgentThanks&amp;RegradsharishKumar.M</description><pubDate>Wed, 24 Feb 2010 05:31:04 GMT</pubDate><dc:creator>macherla.harish</dc:creator></item><item><title>Backup on the fly based on previous backups</title><link>http://www.sqlservercentral.com/Forums/Topic659975-1488-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Backups/65871/"&gt;Backup on the fly based on previous backups&lt;/A&gt;[/B]</description><pubDate>Wed, 18 Feb 2009 17:15:19 GMT</pubDate><dc:creator>jack-311987</dc:creator></item></channel></rss>