hi all,
very simple question, mind not working this monday morning.
how do i get a value from dynamic sql from within stored procedure
e.g
SELECT @Lookup = ViewName FROM #MyTempTable
SET @sql = ' Select Count(*) From ' + @LookUp
EXEC dbo.sp_executesql @sql
I want to be able to get the value of Count(*) in the last statement above and use it in subsequent tsql in the same stored procedure.
thanks!!!