>Hi,
>
>How to get a result of the following dynamic syntax:-
>
>set @posted = 'post_'+ @MONTHNO
>set @sql =('select '+@posted+' from mumonth where year ='+@ACTIVEYEAR)
>set @poststatus = (@sql)
>
>
>Best Regards
Hi Issam,
Please see this
How to return a value from dynamically executed T-SQL code FAQ #8130
http://msdn2.microsoft.com/en-us/library/ms188001.aspx
If it's not broken, fix it until it is.
My Blog