zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

SQLSERVER 使用XP开头的系统默认存储过程

SQLServer存储系统 过程 默认 XP 开头 使用
2023-09-27 14:24:16 时间

1. 根据官网上面的内容进行执行命令

EXEC xp_cmdshell 'dir *.exe';

但是会报错

消息 15281,级别 16,状态 1,过程 xp_cmdshell,行 1 [批起始行 0]
SQL Server 阻止了对组件“xp_cmdshell”的 过程“sys.xp_cmdshell”的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用“xp_cmdshell”。有关启用“xp_cmdshell”的详细信息,请搜索 SQL Server 联机丛书中的“xp_cmdshell”。

2. 查找解决方法 执行为:

sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'xp_cmdshell',1
reconfigure
go

 

3. 查询结果即为: