Given a variable that contains a stored procedure name:
DECLARE @stored_procedure_name varchar(512);
SET @stored_procedure_name = 'some_stored_procedure_name';
How can I execute the stored procedure (without passing in any arguments)?
sql serversql-server-2008-r2
Given a variable that contains a stored procedure name:
DECLARE @stored_procedure_name varchar(512);
SET @stored_procedure_name = 'some_stored_procedure_name';
How can I execute the stored procedure (without passing in any arguments)?
Best Answer
You can use the variable directly:
Please see the BOL Reference on
EXECUTE
.