---
title: "sql server 2005/2008中启用xp_cmdshell(默认是未开启的)  "
author: "flownclouds"
date: "2012-09-06T16:39:13Z"
tags: []
categories: ["数据库"]
slug: "sql-server-2005-2008-xp-cmdshell"
draft: false
lastmod: "2012-09-06T16:39:13Z"
id: 1672857
url: "https://flownclouds.iteye.com/blog/1672857"
---

sql server 2005/2008中启用xp_cmdshell(默认是未开启的)  
4步


-- 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