See if this helps..
INF: Using Output Parameters with sp_executesql
SQL Server FAQ at
"exBK" <chikkodi> wrote in message
news:0b5a01c33f4e$35ea1c80$a001280aphx.gbl...> Is it possible to capture the output of a EXEC() statement
> into a variable ? I construct a dynamic sql which returns
> a single value (SELECT count(*) from X) and I execute this
> sql using EXEC. So is there anyway I can assign the count
> (*) value to a local variable ? Or any other suggestions
> for this issue ? Thanks for your time.