<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1013987" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1013987</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-script-backup#comment-1080867</link>
    <description> &lt;p&gt;You&#039;re going to have to use the built in sytem stored procedures of SQL 2000. You&#039;ll need to use the following:&lt;/p&gt;
&lt;p&gt;sp_add_job&lt;br /&gt;
sp_add_jobstep&lt;br /&gt;
sp_add_jobschedule&lt;/p&gt;
&lt;p&gt;If you&#039;re not comfortable with Stored Procedures then I wouldn&#039;t recommend going any further since system stored proedures can really mess up your SQL Server if used poorly.&lt;/p&gt;
&lt;p&gt;You would have to setup a stored procedure that would call those 3 stored procedures, in the jobstep you would backup the database, in the jobschedule you would setup the schedule of the backup.&lt;/p&gt;
&lt;p&gt;If you&#039;ve got SQL Books online installed you can find more help for these stored procedures.&lt;/p&gt;
 </description>
     <pubDate>Tue, 10 Apr 2001 18:30:10 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1080867 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-script-backup#comment-1080860</link>
    <description> &lt;p&gt;I don&#039;t know how to program sql so I wonder if you could help me to make the following code work as we want. It will run the first time from query analyzer but then should be able to keep on his own backups (using different name for each record)If I leave the same name of &quot;disk&quot; - &quot;backupfile.dat&quot; return errors.&lt;br /&gt;
Sorry if I&#039;m annoying with all these questions but I have to find a solution till tonight and I&#039;m totally inrelative with the subject.... &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;-- Create the backup device for the full testdb backup.&lt;br /&gt;
USE testdb&lt;/p&gt;
&lt;p&gt;EXEC sp_addumpdevice &#039;disk&#039;, &#039;testdb2&#039;,&lt;br /&gt;
   &#039;c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\testdb2.dat&#039;&lt;/p&gt;
&lt;p&gt;--Create the log backup device.&lt;br /&gt;
USE testdb&lt;br /&gt;
EXEC sp_addumpdevice &#039;disk&#039;, &#039;testdbLog&#039;,&lt;br /&gt;
   &#039;c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\testdbLog.dat&#039;&lt;/p&gt;
&lt;p&gt;-- Back up the full MyNwind database.&lt;br /&gt;
BACKUP DATABASE testdb TO testdb2&lt;br /&gt;
WITH&lt;br /&gt;
RETAINDAYS=7&lt;/p&gt;
&lt;p&gt;-- Update activity has occurred since the full database backup.&lt;/p&gt;
&lt;p&gt;-- Back up the log of the MyNwind database.&lt;br /&gt;
BACKUP LOG testdb&lt;br /&gt;
   TO testdbLog&lt;/p&gt;
 </description>
     <pubDate>Tue, 10 Apr 2001 15:28:52 +0000</pubDate>
 <dc:creator>Jacost</dc:creator>
 <guid isPermaLink="false">comment 1080860 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-script-backup#comment-1080854</link>
    <description> &lt;p&gt;That&#039;s the Transact-SQL syntax for BACKUP DATABASE/LOG. This will not execute automatically, it must be triggered either by user or job:&lt;/p&gt;
&lt;p&gt;&#039;Define where to dump database data&lt;br /&gt;
EXEC sp_addumpdevice &#039;disk&#039;, &#039;My_Backup&#039;,&lt;br /&gt;
   DISK =&#039;c:\path\My_Database.dat&#039;&lt;/p&gt;
&lt;p&gt;&#039;Back up My_Database&lt;br /&gt;
BACKUP DATABASE My_Database TO My_Backup&lt;/p&gt;
&lt;p&gt;If you also want to backup the log just add a BACKUP LOG using the same syntax above.&lt;/p&gt;
 </description>
     <pubDate>Tue, 10 Apr 2001 13:32:27 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1080854 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-script-backup#comment-1080853</link>
    <description> &lt;p&gt;The point to do this that I set up a web server for people&lt;br /&gt;
with no experience at all in computers and I have to tell them to run 2-3 script that will create their DB and that&#039;s why I need also a script for keep backup.The will run it once and then they will not have to monitoring anything.&lt;/p&gt;
&lt;p&gt;I found this but I can&#039;t understand it very well&lt;/p&gt;
&lt;p&gt;Backing up an entire database:&lt;/p&gt;
&lt;p&gt;BACKUP DATABASE { database_name | @database_name_var }&lt;br /&gt;
TO &amp;lt; backup_device &amp;gt; [ ,...n ]&lt;br /&gt;
[ WITH&lt;br /&gt;
    [ BLOCKSIZE = { blocksize | @blocksize_variable } ]&lt;br /&gt;
    [ [ , ] DESCRIPTION = { &#039;text&#039; | @text_variable } ]&lt;br /&gt;
    [ [ , ] DIFFERENTIAL ]&lt;br /&gt;
    [ [ , ] EXPIREDATE = { date | @date_var }&lt;br /&gt;
        | RETAINDAYS = { days | @days_var } ]&lt;br /&gt;
    [ [ , ] PASSWORD = { password | @password_variable } ]&lt;br /&gt;
    [ [ , ] FORMAT | NOFORMAT ]&lt;br /&gt;
    [ [ , ] { INIT | NOINIT } ]&lt;br /&gt;
    [ [ , ] MEDIADESCRIPTION = { &#039;text&#039; | @text_variable } ]&lt;br /&gt;
    [ [ , ] MEDIANAME = { media_name | @media_name_variable } ]&lt;br /&gt;
    [ [ , ] MEDIAPASSWORD = { mediapassword | @mediapassword_variable } ]&lt;br /&gt;
    [ [ , ] NAME = { backup_set_name | @backup_set_name_var } ]&lt;br /&gt;
    [ [ , ] { NOSKIP | SKIP } ]&lt;br /&gt;
    [ [ , ] { NOREWIND | REWIND } ]&lt;br /&gt;
    [ [ , ] { NOUNLOAD | UNLOAD } ]&lt;br /&gt;
    [ [ , ] RESTART ]&lt;br /&gt;
    [ [ , ] STATS [ = percentage ] ]&lt;br /&gt;
]&lt;/p&gt;
&lt;p&gt;Backing up specific files or filegroups:&lt;/p&gt;
&lt;p&gt;BACKUP DATABASE { database_name | @database_name_var }&lt;br /&gt;
    &amp;lt; file_or_filegroup &amp;gt; [ ,...n ]&lt;br /&gt;
TO &amp;lt; backup_device &amp;gt; [ ,...n ]&lt;br /&gt;
[ WITH&lt;br /&gt;
    [ BLOCKSIZE = { blocksize | @blocksize_variable } ]&lt;br /&gt;
    [ [ , ] DESCRIPTION = { &#039;text&#039; | @text_variable } ]&lt;br /&gt;
    [ [ , ] DIFFERENTIAL ]&lt;br /&gt;
    [ [ , ] EXPIREDATE = { date | @date_var }&lt;br /&gt;
        | RETAINDAYS = { days | @days_var } ]&lt;br /&gt;
    [ [ , ] PASSWORD = { password | @password_variable } ]&lt;br /&gt;
    [ [ , ] FORMAT | NOFORMAT ]&lt;br /&gt;
    [ [ , ] { INIT | NOINIT } ]&lt;br /&gt;
    [ [ , ] MEDIADESCRIPTION = { &#039;text&#039; | @text_variable } ]&lt;br /&gt;
    [ [ , ] MEDIANAME = { media_name | @media_name_variable } ]&lt;br /&gt;
    [ [ , ] MEDIAPASSWORD = { mediapassword | @mediapassword_variable } ]&lt;br /&gt;
    [ [ , ] NAME = { backup_set_name | @backup_set_name_var } ]&lt;br /&gt;
    [ [ , ] { NOSKIP | SKIP } ]&lt;br /&gt;
    [ [ , ] { NOREWIND | REWIND } ]&lt;br /&gt;
    [ [ , ] { NOUNLOAD | UNLOAD } ]&lt;br /&gt;
    [ [ , ] RESTART ]&lt;br /&gt;
    [ [ , ] STATS [ = percentage ] ]&lt;br /&gt;
]&lt;/p&gt;
&lt;p&gt;Backing up a transaction log:&lt;/p&gt;
&lt;p&gt;BACKUP LOG { database_name | @database_name_var }&lt;br /&gt;
{&lt;br /&gt;
    TO &amp;lt; backup_device &amp;gt; [ ,...n ]&lt;br /&gt;
    [ WITH&lt;br /&gt;
        [ BLOCKSIZE = { blocksize | @blocksize_variable } ]&lt;br /&gt;
        [ [ , ] DESCRIPTION = { &#039;text&#039; | @text_variable } ]&lt;br /&gt;
        [ [ ,] EXPIREDATE = { date | @date_var }&lt;br /&gt;
            | RETAINDAYS = { days | @days_var } ]&lt;br /&gt;
        [ [ , ] PASSWORD = { password | @password_variable } ]&lt;br /&gt;
        [ [ , ] FORMAT | NOFORMAT ]&lt;br /&gt;
        [ [ , ] { INIT | NOINIT } ]&lt;br /&gt;
        [ [ , ] MEDIADESCRIPTION = { &#039;text&#039; | @text_variable } ]&lt;br /&gt;
        [ [ , ] MEDIANAME = { media_name | @media_name_variable } ]&lt;br /&gt;
        [ [ , ] MEDIAPASSWORD = { mediapassword | @mediapassword_variable } ]&lt;br /&gt;
        [ [ , ] NAME = { backup_set_name | @backup_set_name_var } ]&lt;br /&gt;
        [ [ , ] NO_TRUNCATE ]&lt;br /&gt;
        [ [ , ] { NORECOVERY | STANDBY = undo_file_name } ]&lt;br /&gt;
        [ [ , ] { NOREWIND | REWIND } ]&lt;br /&gt;
        [ [ , ] { NOSKIP | SKIP } ]&lt;br /&gt;
        [ [ , ] { NOUNLOAD | UNLOAD } ]&lt;br /&gt;
        [ [ , ] RESTART ]&lt;br /&gt;
        [ [ , ] STATS [ = percentage ] ]&lt;br /&gt;
    ]&lt;br /&gt;
} &lt;/p&gt;
&lt;p&gt;&amp;lt; backup_device &amp;gt; ::=&lt;br /&gt;
    {&lt;br /&gt;
        { logical_backup_device_name | @logical_backup_device_name_var }&lt;br /&gt;
        |&lt;br /&gt;
        { DISK | TAPE } =&lt;br /&gt;
            { &#039;physical_backup_device_name&#039; | @physical_backup_device_name_var }&lt;br /&gt;
    } &lt;/p&gt;
&lt;p&gt;&amp;lt; file_or_filegroup &amp;gt; ::=&lt;br /&gt;
    {&lt;br /&gt;
        FILE = { logical_file_name | @logical_file_name_var }&lt;br /&gt;
        |&lt;br /&gt;
        FILEGROUP = { logical_filegroup_name | @logical_filegroup_name_var }&lt;br /&gt;
    } &lt;/p&gt;
&lt;p&gt;Truncating the transaction log:&lt;/p&gt;
&lt;p&gt;BACKUP LOG { database_name | @database_name_var }&lt;br /&gt;
{&lt;br /&gt;
    [ WITH&lt;br /&gt;
        { NO_LOG | TRUNCATE_ONLY } ]&lt;br /&gt;
}&lt;/p&gt;
 </description>
     <pubDate>Tue, 10 Apr 2001 13:15:45 +0000</pubDate>
 <dc:creator>Jacost</dc:creator>
 <guid isPermaLink="false">comment 1080853 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-script-backup#comment-1080850</link>
    <description> &lt;p&gt;This is not going to work to good. Is there any reason you can&#039;t use the built in backup job in SQL? It doesn&#039;t require any user intervention (unless tape/destination is full)&lt;/p&gt;
&lt;p&gt;Even with script or a component something will have to trigger it to run, unless it&#039;s constantly running. Even then the backups might not always work since SQL locks many of the files and they won&#039;t be available to be backed up.&lt;/p&gt;
&lt;p&gt;The only other way would be to have a mirror of the database and then run ASP/Stored procs that copy any new data into your backup database.&lt;/p&gt;
 </description>
     <pubDate>Tue, 10 Apr 2001 12:38:32 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1080850 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
