Thứ Hai, 17 tháng 1, 2011

Thực hiện nén một file trên Sql Server


--Để có thể thực hiện các câu lệnh Windows command shell (các lệnh như DOS), phải config như sau

GO

-- To update the currently configured value for advanced options.

RECONFIGURE

GO

-- To enable the feature.

EXEC sp_configure 'xp_cmdshell', 1

GO

-- To update the currently configured value for this feature.

RECONFIGURE

GO

--Thực hiện nén một file trên Sql Server bằng file rar.exe

Exec xp_cmdShell 'C:\ws\rar.exe a C:\ws\File1.rar C:\ws\File1.txt'


Không có nhận xét nào:

Đăng nhận xét