How to run a program from SQL?

前端 未结 4 1277
误落风尘
误落风尘 2020-12-20 08:00

I need to implement a tool that runs programs from SQL Server database when a DB record matches some condition. Is there a way to do it?

4条回答
  •  囚心锁ツ
    2020-12-20 08:20

    I would be careful with xp_cmdshell because it can create quite a security hole. Check out this article from http://www.databasejournal.com/features/mssql/article.php/3372131/Using-xpcmdshell.htm

    If the service account has local administration rights then you can use this procedure to perform any windows operating system command.

    Check out this similar question I asked some time ago. After some research I decided the security risk was too great for a production DB server. Your situation might be different and xp_cmdshell might be the answer. SQL Server xp_cmdshell

提交回复
热议问题