declare @cmd varchar(8000), @a char(2)select @a = 'US'select @cmd = 'select gemName,gemType,Statefrom GEmTable where country=' + @Aexec(@cmd)
Declare @MyId intEXEC spcTable1 @Param1 = 'SomeValue', @Param2 = @MyId OUTPUT--this executes the procedure and captures the output which you then pass on to the next procEXEC spcTable2 @Param3 = @MyId