Hi,
I have written a batch file that calls osql to run a backup by passing a backup.sql file to osql.
Here's what I have:
A batch file containing the following:
osql -E -i c:\backup.sql
In the backup.sql file is the following:
BACKUP DATABASE BESMgmt TO DISK = 'C:\BES DB Backups\DBs\BESMgmt.bak'
BACKUP DATABASE master TO DISK = 'C:\BES DB Backups\DBs\master.bak'
BACKUP DATABASE model TO DISK = 'C:\BES DB Backups\DBs\model.bak'
BACKUP DATABASE msdbdata TO DISK = 'C:\BES DB Backups\DBs\msdbdata.bak'
BACKUP DATABASE temp TO DISK = 'C:\BES DB Backups\DBs\temp.bak'
Go
Yet when I run the batch file I get:
C:\Bes-DB-Backups\Batch-files>osql -E -i c:\backup.sql
Cannot open input file - c:\backup.sql
No such file or directory
Well it's lying! There is a file with that name in the location I've specified so why can't it find it? What am I doing wrong?
Thanks for any help you can offer.
I have written a batch file that calls osql to run a backup by passing a backup.sql file to osql.
Here's what I have:
A batch file containing the following:
osql -E -i c:\backup.sql
In the backup.sql file is the following:
BACKUP DATABASE BESMgmt TO DISK = 'C:\BES DB Backups\DBs\BESMgmt.bak'
BACKUP DATABASE master TO DISK = 'C:\BES DB Backups\DBs\master.bak'
BACKUP DATABASE model TO DISK = 'C:\BES DB Backups\DBs\model.bak'
BACKUP DATABASE msdbdata TO DISK = 'C:\BES DB Backups\DBs\msdbdata.bak'
BACKUP DATABASE temp TO DISK = 'C:\BES DB Backups\DBs\temp.bak'
Go
Yet when I run the batch file I get:
C:\Bes-DB-Backups\Batch-files>osql -E -i c:\backup.sql
Cannot open input file - c:\backup.sql
No such file or directory
Well it's lying! There is a file with that name in the location I've specified so why can't it find it? What am I doing wrong?
Thanks for any help you can offer.