DECLARE @T INT
EXEC('SELECT @T = count(user_id) FROM ( .. .. .. )')
PRINT @T
I guess the example is sufficient to explain what i am trying to do, i create dynamic query and want to access its count outside the exec statement.
I am using SQL 2000. How can this be achieved ?