Created
November 2, 2011 19:06
-
-
Save arviman/1334567 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @proc varchar(255), @dynamicSql varchar(255), @ParamDefinition varchar(255), @Actor1 nvarchar(255),@Actor2 nvarchar(255) | |
SET @proc = 'OnScreenChemistry' | |
--*cursor declare/fetch stuff* | |
--set @Actor1, @Actor2 values here from your cursor | |
--create your query with placeholders for the parameters to your stored proc | |
SET @dynamicSql = 'exec ' + @proc + '@Actor1Param,@Actor2Param,@ResultParam output' | |
--create definitions for your parameter placeholders | |
Set @ParamDefinition = '@Actor1Param nvarchar(255) ,@Actor2Param nvarchar(255), @ResultParam float(53) output' | |
-- call your stored proc using your dynamic query and pass in values to your parameters. | |
execute sp_executesql | |
@dynamicsql | |
,@ParamDefinition | |
,@Actor1Param = @Actor1 | |
,@Actor2Param = @Actor2 | |
,@ResultParam = @Result output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment