As a security safeguard, Microsoft has turned off the use of xp_cmdshell by default in the latest version of SQL Server. This built-in extended stored procedure can come in quite handy as it gives you the ability to run any command line process from a stored procedure or job. To enable xp_cmdshell, do the following…
1. Click the Start button.
2. Select All Programs.
3. Navigate to the Microsoft SQL Server 2005 folder.
4. On the flyout, mouseover Configuration Tools.
5. Select SQL Server Surface Area Configuration.
6. The SQL Server 2005 Surface Area Configuration window will appear.
7. At the bottom of the window, select Surface Area Configuration for Features.
8. In the left pane, under Database Engine, select xp_cmdshell.
9. Check the Enable xp_cmdshell checkbox.
10. Click OK.
11. Close the SQL Server 2005 Surface Area Configuration window.