在SqlServer2005里运行exe

首先,打开sql server的高级选项开关:
EXEC sp_configure 'show advanced options', 1
RECONFIGURE

再打开shell执行开关:
EXEC sp_configure 'xp_cmdshell', 1
RECONFIGURE

执行你想要的exe程序:
exec   xp_cmdshell 'c:\Holleworld.exe'

安全期间,最后关闭shell执行开关:
EXEC sp_configure 'xp_cmdshell', 0
RECONFIGURE

你可能感兴趣的:(sqlserver2005)