Solved

SQL 2008 R2 Express Backup run using Task Scheduler

Posted on 2013-05-13
4
503 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:
micen earned 500 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

825 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