Automatic Backup for SQL Express 2005 - TechRepublic
Question
November 16, 2010 at 07:12 AM
azgarde

Automatic Backup for SQL Express 2005

by azgarde . Updated 15 years, 7 months ago

Hi, I was looking for a way to automate a backup for SQL Server 2005 Express. First, I created a batch file that contains:

c:
cd backup
sqlcmd -i c:\backup\backup.sql

Basically, what it does is just change the directory to C:\Backup then it launches the Backup.sql

Backup.sql contains:

EXEC sp_addumpdevice ‘disk’, ‘dbbu’,
‘c:\Backup\dbbu.bak’
BACKUP database dbtest TO dbbu
GO

What it does is only “backuping” the database Dbtest to the file Dbbu.back in the path C:\Backup

However, when I launch it, I get an error telling me that An error occured while establishing connection to the server, that might be caused by SQL Server not accepting remote connection, although that I am running the operation locally.

Any ideas ?

This discussion is locked

All Comments