Modify a stored procedure execution script

Copper Contributor

Greetings!

I am relatively new to SQL and have just written my first stored procedure. My goal is to create a Job that runs this procedure, but I am running into some issues. The procedure takes no parameters and when I execute, the default execution script returns the result table (which is all I want) but also a 'Return Value' (which I do not want). When I manually remove the: SELECT 'Return Value' =@return_value from the default execution script, I get the desired result. How can I make this change prior to execution and make it permanent so that I can run this as a Job and always get my intended outcome?

1 Reply

@Rich_Beverungen Use a simple EXEC command, like 

EXEC spYourProcedure;

EXECUTE (Transact-SQL) - SQL Server | Microsoft Learn