How do I use output parameters with Character String Exec? Consider following query with "standard" syntax:
DECLARE @testString nvarchar(50);
EXEC testProcedure @param1 = @testString OUTPUT
SELECT 'result ' = @testString
go
How to re-create exactly same result with character string exec, neither
EXEC ( 'testProcedure @param1 = @testString OUTPUT' )
nor
EXEC ( 'testProcedure @param1 = ' + @testString + ' OUTPUT' )
seems to work: the result is either NULL or Must declare the scalar variable "@testString" error.