xp_cmdshell オプションは、システム管理者がxp_cmdshell拡張ストアド プロシージャをシステム上で実行できるかどうかを制御できるようにするSQL Serverサーバー構成オプションです。 新しいインストールでは、 xp_cmdshell オプションは既定で無効になっており、ポリシー ベースの管理を使用するか、次のコード例のように sp_configure システム ストアド プロシージャを実行することで有効にできます。
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1;
GO
-- To update the currently configured value for advanced options.
RECONFIGURE;
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1;
GO
-- To update the currently configured value for this feature.
RECONFIGURE;
GO