Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 532
  • Last Modified:

SQL 2008 R2 Express Backup run using Task Scheduler

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
normajm400
Asked:
normajm400
1 Solution
 
rjanowskyCommented:
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
 
David ToddSenior DBACommented:
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
 
Micael CarlssonDBA ConsultantCommented:
Hi.

This works on my express SQL's:

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

Regards

Micael
0
 
normajm400Author Commented:
Perfect!! Thank you very much.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now