Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
binodbdrchand
Starting Member
1 Post |
Posted - 2009-06-18 : 05:45:08
|
Here is the batch file :@ECHO OFFfor /f "tokens=1-5 delims=/ " %%d in ("%date%") do set today=%%e-%%f-%%gset dirPath=C:\Backups\%today%mkdir %dirPath%ECHO Directory %dirPath% created.set filePath=%dirPath%\test before day end.bakset sql=EXEC BackupDB %filePath%osql -U username -P passwd -d Test -Q "%sql%"ECHO DB backed up.Here is the stored procedure :CREATE PROCEDURE BackupDB @path VARCHAR(100) ASBACKUP DATABASE TestTO DISK = @pathGOThe given error is :Msg 170, Level 15, State 1, Server SERVER, Line 1Line 1: Incorrect syntax near '\'.Someone please help. |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-06-18 : 05:52:14
|
fast shot: test before day end.bak should be test_before_day_end.bak No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
|
|
|