Link to home
Start Free TrialLog in
Avatar of justin_smith
justin_smithFlag for Australia

asked on

getting values from sp_executesql

HI

It is something similar to this i am trying to do

declare @query nvarchar(500) ,
            @value int

set @query ='select count(*) from table_a'

i want to assign the count to @value  with sp_executesql

How can i do this

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Louis01
Louis01
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of justin_smith

ASKER

This is the best solution i got through EE ever.. it was so quick and spot on.. i really appreciate that
Avatar of Guy Hengel [angelIII / a3]
remarks: if you don't need dynamic sql, don't use dynamic sql!
but I guess that you simplified your example in that regards :)