var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Problem in using sqlmaint in command prompt
I try to backup DB (DatabaseA) in ServerA using sqlmaint utility in command prompt.
The sqlmaint.exe does reside in ..Mssql\Binn Folder.
Below is the command i used (MS-DOS):
..\Binn>sqlmaint -S ServerA -U "sa" -P "########" -D DatabaseA
-BkUpDB C:\Temp -HtmlRpt BackupRpt.html
When I execute the command, it only shows a list of the commands as if I execute -? command. There's NO any other messages that indicate the backup command is being executed.
When I check in the C:\Temp folder, there's no BackupRpt.html file.
Anyone got any idea?
Last edited by ckway; 02-14-04 at 00:00.
Make sure you are using short path names when you execute the program. I.E.: C:\Progra~1\Micros~1\Binn\sqlmaint.exe
Also, what's with the ">" symbol? My DOS is rusty, but I think you should just use a path separator like my example above.
Thanks for the reply.
My DOS is rusty also.
What I mean by ">" is I'm typing the command at the Binn directory where sqlmaint.exe resides in. The actual command is only:
sqlmaint -S ServerA -U "sa" -P "########" -D DatabaseA -BkUpDB C:\Temp -HtmlRpt BackupRpt.html
I got this command from #Books Online, but I'm not sure whether I'm using the right way to execute it.
Basically, what I intend to do is to perform a SQL Server DB Backup just by typing a command in MS-DOS, instead of using EM.
I tried to run DBCC CHECKDB using sqlmaint.exe in command line:
sqlmaint -S ServerA -U "sa" -P "########" -D DatabaseA - CkDB -Rpt C:\Temp\Check.txt
It worked out fine and a report is generated in the Temp folder.
This puzzles me as I wonder why BkUpDB can't work?
Is there sth wrong with the syntax?
Try creating a backup job through the Maintenance Plan wizard. It will create a job that calls the maintenance utility and you can copy the syntax for your command line job.
Blindman, you're the man!
The commands in Maintenance Plan's Job can't work directly in DOS, but it gave me the rough idea to debug.
Glad to tell you that the new command work perfectly, :>
sqlmaint -S ServerA -U "sa" -P "########" -D DatabaseA -BkUpDB -BkUpMedia DISK -UseDefDir -BkExt "BAK" -VrfyBackup -Rpt "C:\Temp\BkRpt.txt"
Once again, Thanks alot!