删除扩展存储过过程xp_cmdshell的语句

2010-08-28 10:47:36来源:西部e网作者:

删除扩展存储过过程xp_cmdshell的语句:
exec sp_dropextendedproc 'xp_cmdshell'

恢复cmdshell的SQL语句
EXEC sp_addextendedproc xp_cmdshell ,@dllname ='xplog70.dll'

在sqlserver的query analyer中运行以下命令就可以去掉sa的xp-cmdshell权限:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[xp_cmdshell]') and OBJECTPROPERTY(id, N'IsExtendedProc') = 1) exec sp_dropextendedproc N'[dbo].[xp_cmdshell]' GO

一般SQL2000是通过下面语句恢复: EXEC sp_addextendedproc xp_cmdshell ,@dllname ='xplog70.dll'
而SQL97是通过下面语句恢复 EXEC sp_addextendedproc xp_cmdshell ,@dllname ='xpsql70.dll'

sp_addextendedproc'xp_cmdshell','xpsql70.dll' (sql 7.0) sp_addextendedproc'xp_cmdshell','xplog70.dll' (sql 2000)

关键词:sqlserver

赞助商链接: