Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Execute a varchar string variable?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00434888
Message ID:
00434902
Vues:
13
Are you looking for something like this:

DECLARE @cmd varchar(2000)
SET @cmd = 'SELECT COUNT(*) FROM x'
EXECUTE (@cmd)

I've not directly tried it but I can't think of any reason why it wouldn't work. There are something that you need to be aware of. The statement is considered another batch. It doesn't have access to any of the variables within the calling batch. I'm also not sure if you would be able to access the Inserted and Deleted tables.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform