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).