Execute stored procedure named as a string
How can I execute a stored procedure named as a string
开发者_如何学编程I tried this:
EXEC CAST(@GetDD AS StoredProcedure);
Create a dynamic SQL string, and execute that:
declare @sql varchar(512);
set @sql = 'exec ' + @GetDD;
EXEC (@sql);
精彩评论