这是什么原因,SQL创建数据库,这个错误是什么?
消息 15281,级别 16,状态 1,过程 xp_cmdshell,第 1 行
SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'xp_cmdshell'。有关启用 'xp_cmdshell' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器"。 
消息 5133,级别 16,状态 1,第 2 行
对文件 "D:\project\bbsDB_data.mdf" 的目录查找失败,出现操作系统错误 2(系统找不到指定的文件。)。
消息 1802,级别 16,状态 1,第 2 行
CREATE DATABASE 失败。无法创建列出的某些文件名。请查看相关错误。

解决方案 »

  1.   

    系统管理员可以通过使用 sp_configure 启用 'xp_cmdshell'提示很清楚了呀,用过程启用
      

  2.   

    --是否允许运行系统存储过程xp_cmdshell
    sp_configure 'show advanced options',1
    reconfigure
    go
    sp_configure 'xp_cmdshell',1
    reconfigure
    go
    sp_configure 'show advanced options',0
    reconfigure
    go
      

  3.   

    EXEC sp_configure 'show advanced options', 1
    GO
    -- 重新配置
    RECONFIGURE
    GO
    -- 启用xp_cmdshell
    EXEC sp_configure 'xp_cmdshell', 1
    GO
    --重新配置
    RECONFIGURE
    GO--执行想要的xp_cmdshell语句
    Exec xp_cmdshell 'query user'
    GO--用完后,要记得将xp_cmdshell禁用(出于安全考虑)
    -- 允许配置高级选项
    EXEC sp_configure 'show advanced options', 1
    GO
    -- 重新配置
    RECONFIGURE
    GO
    -- 禁用xp_cmdshell
    EXEC sp_configure 'xp_cmdshell', 0
    GO
    --重新配置
    RECONFIGURE
    GO