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?
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?