Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enable/Disable global variables from a procedure
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00192854
Message ID:
00193974
Vues:
18
>How can one create a global variable in SQLSERVER? I would like to be able to create a global variable from within a procedure, and then have other procedures read the value of that variable, and take certain action on it. More specifically I would like to enable / disbale a trace_flag from withing a procedure and then based on the value of this flag, display a debugging message or not.

SQL Server does not support global variables. Could you create a control table for you application and write a row for your SPID. Then you could place whatever flags your application needs in there. Later, create a job that would remove rows for SPIDs that are no longer active.

HTH

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

Click here to load this message in the networking platform