Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL 2008 R2 Express Backup run using Task Scheduler

Posted on 2013-05-13
4
Medium Priority
?
527 Views
Last Modified: 2013-05-14
Hello all,

Am trying to automate backup of SQL 2008 R2 Express database.  I have the backup script saved to a file and it runs fine.  I created it by right clicking on the database, Tasks, Back Up, set the location, name, verify, then saved the script to file.   There are only two databases - master and the one I'm trying to backup.  However, I'm having a problem getting the syntax right to automate it using Task Scheduler.

Under the action arguments I have tried all the following with no success...

-S .\EXPRESS -i C:\SQLBU\BUScript.sql
-S .\MSSQLSERVER -i C:\SQLBU\BUScript.sql
-S  \MSSQLSERVER -i C:\SQLBU\BUScript.sql
-S (local)\MSSQLSERVER -i C:\SQLBU\BUScript.sql

The SQMCMD command prompt shows, then disappears, the task stays running, but no backup occurs.

I have this working fine in my test environment, but it actually has a "named instance".  The one I'm trying to backup is using the default Services (MSSQLSERVER).  

Any suggestions?

Thank you!
0
Comment
Question by:normajm400
4 Comments
 
LVL 10

Expert Comment

by:rjanowsky
ID: 39163619
Have a look at this SQLCMD Default Instance or Named Instance thread at a Microsoft SQL-Server forum. I think, that might explain it.
0
 
LVL 35

Expert Comment

by:David Todd
ID: 39163640
Hi,

Try
-S <yourservername> -I C:\SQLBU\BUScript.sql

Default means that there is no instance name, although you will see the MSSQLSERVER used in some contexts.

Regards
  David
0
 
LVL 1

Accepted Solution

by:
Micael Carlsson earned 2000 total points
ID: 39164042
Hi.

This works on my express SQL's:

SQlCMD -S Localhost -i C:\SQLBU\BUScript.sql

Regards

Micael
0
 

Author Closing Comment

by:normajm400
ID: 39166152
Perfect!! Thank you very much.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
Integration Management Part 2
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question