Search This Blog

Monday, October 21, 2013

Run exe from SQL Server

SQL ServerSystem Stored Procedures > xp_cmdshell

xp_cmdshell is an extended stored procedure provided by Microsoft and stored in the master database.
This procedure allows you to issue operating system commands directly to the Windows command shell via T-SQL code.

Example: How to run executable from SQL Server?

exec master.dbo.xp_cmdshell 'mkdir "c:\MyDir\"'