Can you explain on what you are trying to achieve?
To my knowledge Global Variables in sql server are all server defined, all that are prefixed with @@, which cannot be assigned values by a user, but they are assigned values based on activities performed on the server.
Eg: @@ERROR contains ZERO when a last executed transcation is successfully done. Else a non zero value is stored in it.
If you are looking for user defined variables that needs to be global, I am not sure if you can declare something like that in one set of code and use that in another set of code. I don't think that is possible.
Hope that helps.
Cheers!
_________________________
- Vijay G
Strive for Perfection
|