SQL Backup in SQL Server 2005 Express
Posted on 2011-09-24
I am looking to run a daily automated backup for SQL Server 2005 Express.
I created a batch file that references a .SQL file. I am getting an error.
The batch file and .sql file, along with the error are below:
sqlcmd -S "C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\sql-daily-backup.sql"
BACKUP DATABASE [DatabaseName] TO DISK = N'C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\DatabaseName.bak' WITH NOFORMAT, NOINIT, NAME = N'DatabaseName-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
ERROR that is generaed:
C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL>sqlcmd -S "C:\Program
Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\sql-daily-backup.sql"
HResult 0xFFFFFFFF, Level 16, State 1
SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi
shing a connection to the server. When connecting to SQL Server 2005, this failu
re may be caused by the fact that under the default settings SQL Server does not
allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
I checked under the default instance and allow remote connections is enabled. Any ideas?