Solved

SQL 2008 R2 Express Backup run using Task Scheduler

Posted on 2013-05-13
4
502 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now