0

I have an executable on the server. I want to execute that .exe file in my stored procedure. What is the correct way to do it other than using xp_cmdshell?

sticky bit
  • 36,626
  • 12
  • 31
  • 42
Himanshu Jindal
  • 43
  • 1
  • 1
  • 7

1 Answers1

1

If you have to do this, I would create a Job and call it from your stored procedure using sp_start_job: https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-start-job-transact-sql?view=sql-server-2017

There is a simple example here on how to create the job to do it: How execute exe file from sql agent or job?

JMabee
  • 2,230
  • 2
  • 9
  • 13