Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

backup script help!

 
   Database Help (Home) -> MSDE RSS
Next:  MSDE 2000 SP3A upgrade  
Author Message
James Landon

External


Since: May 06, 2008
Posts: 19



(Msg. 1) Posted: Mon Jun 23, 2008 9:58 am
Post subject: backup script help!
Archived from groups: microsoft>public>sqlserver>msde (more info?)

Hi,

I am having a very difficult time trying to figure out how to write a script
for a SQL backup. I will try and explain what I am trying to do.

The majority of our computers out at customer sites are running access
databases, however a few other computers are running on a SQL Database.
Currently we are backing up the Access DB's by connecting through a VPN and
copying the "live data" directly from the customers end to the local
computer. Then we transfer the MDB and TAG file back to our end via a file
transfer option on the VPN that we use. That has been working for us so far
with the 15 computers we have out there. Obviously, the issue with this is
it is not efficient at all and as we grow the number of computers we have
out there it will take more and more time to complete. Plus we need to
eventually upgrade everything to the SQL DB.

We are using MSDE 2005 instead if the Full SQL Server and through the
newsgroups I have learned that there is no job scheduler built in to the
express edition to set an auto backup. I need to find a way to create a
auto-backup for the sql database on the customers computer before we get
into the office on the morning.

Unfortunately, I do not very much experience at all with writing code. I can
provide all the needed details as far as server name, log-on, passwords
etc....however I cannot write the backup script needed. Is it possible to
for someone to either help me write this code or direct me to a website that
might provide a lot more detail on how to do this? I will appreciate any
info you can give me on this matter. Thanks in advance for your help.

Sincerely James

 >> Stay informed about: backup script help! 
Back to top
Login to vote
Andrea Montanari

External


Since: Sep 13, 2003
Posts: 498



(Msg. 2) Posted: Mon Jun 23, 2008 4:48 pm
Post subject: Re: backup script help! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

hi,
James Landon wrote:
> Hi,
>
> I am having a very difficult time trying to figure out how to write a
> script for a SQL backup. I will try and explain what I am trying to
> do.
> The majority of our computers out at customer sites are running access
> databases, however a few other computers are running on a SQL
> Database. Currently we are backing up the Access DB's by connecting
> through a VPN and copying the "live data" directly from the customers
> end to the local computer. Then we transfer the MDB and TAG file back
> to our end via a file transfer option on the VPN that we use. That
> has been working for us so far with the 15 computers we have out
> there. Obviously, the issue with this is it is not efficient at all
> and as we grow the number of computers we have out there it will take
> more and more time to complete. Plus we need to eventually upgrade
> everything to the SQL DB.
> We are using MSDE 2005 instead if the Full SQL Server and through the
> newsgroups I have learned that there is no job scheduler built in to
> the express edition to set an auto backup. I need to find a way to
> create a auto-backup for the sql database on the customers computer
> before we get into the office on the morning.
>
> Unfortunately, I do not very much experience at all with writing
> code. I can provide all the needed details as far as server name,
> log-on, passwords etc....however I cannot write the backup script
> needed. Is it possible to for someone to either help me write this
> code or direct me to a website that might provide a lot more detail
> on how to do this? I will appreciate any info you can give me on this
> matter. Thanks in advance for your help.
> Sincerely James

for SQLExpress you have to rely on alternate scheduler as, as you already
pointed out, the SQL Agent component is not available for this sku..
usually you can use the native OS scheduler, where you define a task to
execute a .cmd file which include a call to SQLCmd.exe, the command line
tool provided along with SQL Server\SQLExpress, [
http://msdn.microsoft.com/en-us/library/ms162773.aspx ] with a query
statement that performs the required backup, thus a
BACKUP [dbname] TO DISK = 'full_path';
this scenario is "gratis" and is well supported and even explained in good
articles as http://www.sqldbatips.com/showarticle.asp?ID=27 and
http://www.sqldbatips.com/showarticle.asp?ID=29..
or you can rely on an alternate scheduler like
http://www.valesoftware.com/products-express-agent.php (commercial) or
http://www.codeproject.com/KB/database/SQLAgent.aspx (free)..
a third solution is based on the SQLExpress limited support of the Service
Broker, ase described in
http://blogs.msdn.com/rogerwolterblog/archive/2006/04/13/575974.aspx ..
regards
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz http://www.hotelsole.com
DbaMgr2k ver 0.21.1 - DbaMgr ver 0.65.1 and further SQL Tools
--------- remove DMO to reply

 >> Stay informed about: backup script help! 
Back to top
Login to vote
Todd C

External


Since: Jan 31, 2007
Posts: 106



(Msg. 3) Posted: Wed Jul 23, 2008 12:11 pm
Post subject: Re: backup script help! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

James:
To add to Andrea's insightful reply, you can also use the SQLCmd command
line utility to execute a script, and/or output the results to a file.

Check Books On Line for more info on SQLCmd, namely the -S(Server), -i
(input file)and -o (output file) switches.

Now, with your scheduling tool of choice, you could execute something like
sqlcmd -S <MachineName>\SQLEXPRESS -i <file to execut> -o <file to capture
results>

By swapping out your input file, you can perform maintenance on the
databases and other tasks without needing to re-program the scheduler.

Do yourself a favor and dive into learining T-SQL. If you are going to be
supporting remote SQL installations, it will come in handy.
--
Todd C

"Andrea Montanari" wrote:

> hi,
> James Landon wrote:
> > Hi,
> >
> > I am having a very difficult time trying to figure out how to write a
> > script for a SQL backup. I will try and explain what I am trying to
> > do.
> > The majority of our computers out at customer sites are running access
> > databases, however a few other computers are running on a SQL
> > Database. Currently we are backing up the Access DB's by connecting
> > through a VPN and copying the "live data" directly from the customers
> > end to the local computer. Then we transfer the MDB and TAG file back
> > to our end via a file transfer option on the VPN that we use. That
> > has been working for us so far with the 15 computers we have out
> > there. Obviously, the issue with this is it is not efficient at all
> > and as we grow the number of computers we have out there it will take
> > more and more time to complete. Plus we need to eventually upgrade
> > everything to the SQL DB.
> > We are using MSDE 2005 instead if the Full SQL Server and through the
> > newsgroups I have learned that there is no job scheduler built in to
> > the express edition to set an auto backup. I need to find a way to
> > create a auto-backup for the sql database on the customers computer
> > before we get into the office on the morning.
> >
> > Unfortunately, I do not very much experience at all with writing
> > code. I can provide all the needed details as far as server name,
> > log-on, passwords etc....however I cannot write the backup script
> > needed. Is it possible to for someone to either help me write this
> > code or direct me to a website that might provide a lot more detail
> > on how to do this? I will appreciate any info you can give me on this
> > matter. Thanks in advance for your help.
> > Sincerely James
>
> for SQLExpress you have to rely on alternate scheduler as, as you already
> pointed out, the SQL Agent component is not available for this sku..
> usually you can use the native OS scheduler, where you define a task to
> execute a .cmd file which include a call to SQLCmd.exe, the command line
> tool provided along with SQL Server\SQLExpress, [
> http://msdn.microsoft.com/en-us/library/ms162773.aspx ] with a query
> statement that performs the required backup, thus a
> BACKUP [dbname] TO DISK = 'full_path';
> this scenario is "gratis" and is well supported and even explained in good
> articles as http://www.sqldbatips.com/showarticle.asp?ID=27 and
> http://www.sqldbatips.com/showarticle.asp?ID=29..
> or you can rely on an alternate scheduler like
> http://www.valesoftware.com/products-express-agent.php (commercial) or
> http://www.codeproject.com/KB/database/SQLAgent.aspx (free)..
> a third solution is based on the SQLExpress limited support of the Service
> Broker, ase described in
> http://blogs.msdn.com/rogerwolterblog/archive/2006/04/13/575974.aspx ..
> regards
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz http://www.hotelsole.com
> DbaMgr2k ver 0.21.1 - DbaMgr ver 0.65.1 and further SQL Tools
> --------- remove DMO to reply
>
>
>
 >> Stay informed about: backup script help! 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
cannot backup SQL - I'm having trouble backing up SQL data using Microsoft SQL Server Management Studio Express. When I try backing up to the destination I get the error message: "Property backupdirectory is not availabe for Settings..

Restore backup set - Hi all, How can I restore a database backup set created from sql server 2005 developer edition to sql server express 2005? Vijayakumar

Using SQL Server Enterprise Manager to Backup to Another S.. - Hi all ~ I've got SQL Server Enterprise Manager running on gb-01 and the database is located on gb-02. I'd like to get Enterprise Manager to backup the database located on gb02 to the other server gb01 across the network. Unfortunately, the file syste...

Install MSDE in XP - Hi all, I have a problem with MSDE installation. Here is the last part of error log. === Logging stopped: 10/10/2003 17:49:00 === MSI (c) (44:64): Note: 1: 1708 MSI (c) (44:64): Product: Microsoft SQL Server Desktop Engine -- Installation operation...

Clone SQL DB (using VB?) - Hi all, I'm having a SQL Server database called X. For testing and training, I would like to make a copy of the entire DB to Y. This copy should include all data, properties, indexes, views, etc. Unfortunately, all my attempts to automate this..
   Database Help (Home) -> MSDE All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]