Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get a result from dynamically executed SQL
Message
 
 
À
24/03/2008 09:58:34
Issam Mansour
Jordan Business Machines
Amman, Jordanie
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01304869
Message ID:
01304870
Vues:
11
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform