SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 zip backup file in sql command
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

amirs
Posting Yak Master

India
244 Posts

Posted - 04/12/2012 :  05:10:39  Show Profile  Reply with Quote
Dear Member

I have zip backup file to use following command

DECLARE @SERVER VARCHAR(100), @COMMAND VARCHAR(100), @FILE VARCHAR(100),@PATH VARCHAR(30)
SET @SERVER = @@SERVERNAME

SET @COMMAND = '"C:\Program Files\WinRAR\RAR.exe" A "D:\SQLBACKUPS\FILE_BACKUP.BK"'

EXEC XP_CMDSHELL @COMMAND

but i got a following error
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

i think it is not read a program file path so how to execute this command

tkizer
Almighty SQL Goddess

USA
35007 Posts

Posted - 04/12/2012 :  12:33:27  Show Profile  Visit tkizer's Homepage  Reply with Quote
Add the path to the "path" environmental variable on the server and then you won't need to specify the path at all, just rar.exe. You'll need to restart the SQL service though as it puts the variables in memory.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000