Home Forums SQL Server 2005 T-SQL (SS2K5) variable in dynamic pivot RE: variable in dynamic pivot
spin
Hall of Fame
Points: 3274
More actions
November 13, 2013 at 1:42 pm
#1666203
got it....
just needed to add brackets to the @query variable when it's being executed to stop it being mistaken for a stored proc, so:
exec (@query)