SQLUSA

Microsoft SQL Server 2000

Best Practices

 

How to execute a cmd file?

 

The following sample copy file command shell can be saved into a file called weeklybackup.cmd:

 

XCOPY D:\backup\accountmaster.bak \\ServerIP\D$\backup\accountmasterweekly.bak /Q

 

The cmd file can contain other operating system commands as well. It can be executed from xp_cmdshell or SQL Server Agent just by giving the name "weeklybackup.cmd".

The World Leader in SQL Server Training
 
SQLUSA.com Home Page