关于SQL创建文件夹

yjfnwcw 2010-04-10 08:50:28
SQL code
/*创建文件D:\bank*/
EXEC xp_cmdshell 'mkdir E:\bank',NO_OUTPUT
[/Quote]
为什么执行后出现错误:消息 15281,级别 16,状态 1,过程 xp_cmdshell,第 1 行
SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'xp_cmdshell'。有关启用 'xp_cmdshell' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器"。

先在此谢谢了
...全文
194 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
yjfnwcw 2010-04-10
  • 打赏
  • 举报
回复
obuntu 2010-04-10
  • 打赏
  • 举报
回复


楼主好活泼啊。
yjfnwcw 2010-04-10
  • 打赏
  • 举报
回复
KNOW
多写了个'
N'
yjfnwcw 2010-04-10
  • 打赏
  • 举报
回复
OK!
I KNOWN !
THANK YOU!

htl258_Tony 2010-04-10
  • 打赏
  • 举报
回复
SP_CONFIGURE 'show advanced options',1--显示高级参数选项
GO
RECONFIGURE
GO
SP_CONFIGURE 'Ad Hoc Distributed Queries',1--这条是打开Openrowset和Opendatasource的,此处用不到,也可以省略
GO
RECONFIGURE
GO
SP_CONFIGURE 'xp_cmdshell',1--打开xp_cmdshell
GO
RECONFIGURE
GO
SP_CONFIGURE 'show advanced options',0 --关闭显示高级参数选项
RECONFIGURE
GO
yujunlin32167 2010-04-10
  • 打赏
  • 举报
回复
-- 附:xp_cmdshell 打开的代码:
SP_CONFIGURE 'show advanced options',1--打开高级设置
GO
RECONFIGURE
GO
SP_CONFIGURE 'Ad Hoc Distributed Queries',1--不清楚,英语不过关..
GO
RECONFIGURE
GO
SP_CONFIGURE 'xp_cmdshell',1--配置完成
GO
RECONFIGURE
GO
RECONFIGURE
GO
以上是从英语翻译的意思...望指教...
yjfnwcw 2010-04-10
  • 打赏
  • 举报
回复
能否把那些参数是什么意思写清楚点啊
--  附:xp_cmdshell 打开的代码:
SP_CONFIGURE 'show advanced options',1--说明哈
GO
RECONFIGURE
GO
SP_CONFIGURE 'Ad Hoc Distributed Queries',1--说明哈
GO
RECONFIGURE
GO
SP_CONFIGURE 'xp_cmdshell',1--说明哈
GO
RECONFIGURE
GO
RECONFIGURE
GO
htl258_Tony 2010-04-10
  • 打赏
  • 举报
回复
另,建议用以下语句:

EXEC master..xp_cmdshell 'mkdir E:\bank',NO_OUTPUT


防止在程序中无法调用xp_cmdshell
htl258_Tony 2010-04-10
  • 打赏
  • 举报
回复
--  附:xp_cmdshell 打开的代码:
SP_CONFIGURE 'show advanced options',1
GO
RECONFIGURE
GO
SP_CONFIGURE 'Ad Hoc Distributed Queries',1
GO
RECONFIGURE
GO
SP_CONFIGURE 'xp_cmdshell',1
GO
RECONFIGURE
GO
RECONFIGURE
GO
yjfnwcw 2010-04-10
  • 打赏
  • 举报
回复

先来顶哈
呵呵
/*创建文件D:\bank*/
EXEC xp_cmdshell 'mkdir E:\bank',NO_OUTPUT

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧