I am working with SQL Express and found myself surprised when I tried to automate a backup...ÃÂ No Agent.
So I am trying to create a simple backup script to run from the command line and probably schedule through the scheduled task manager.
here is my problem.ÃÂ I get the following error :
Msg 2812, Level 16, State 62, Server FIREFLY\SQLEXPRESS, Line 1
Could not find stored procedure 'B'.
Here is the batch file
sqlcmd -i c:\temp\test\DBbackup.sql -o c:\temp\test\output.txt -S FIREFLY\SQLEXPRESS
And here is the sql input file :
BACKUP DATABASE [DNNDEV] TOÃÂ DISK = 'C:\temp\test\dnndev.bak' WITH NOFORMAT, NOINIT,ÃÂ NAME = 'dnndev-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,ÃÂ STATS = 10;
If I put a USE statement in front of my backup statement - the error message changes to
Could not find stored procedure 'U'.
So it would appear to list the first character encountered.
As a sanity check I created a similar process which does a select * from a table and I do not get an error saying :Could not find stored procedure 'S'. - instead all is well and I get my output and no error
If I try the backup command in SQLCMD interactively it works.
so what the heck am I missing ?
Thank you for any help...
View Complete Post