August 28, 2003 at 1:15 am
Can I declare a user defined global variable?
I want to use a variable and to see that variable in many connections.
Except the spolutions with global temporary tables and execute them into a variable there is other solution for this task?
Thank you for your answer.
astefan
astefan
August 28, 2003 at 7:31 am
T-SQL has no concept of global variable in the way you described. So the solution you outlined is the way to go. You may however need some careful planning if different connections will be updating the column of the global temporary table at the same time.
Joseph
August 29, 2003 at 12:38 pm
If you are trying to share variables between stored procedures, have a look at this
http://www.algonet.se/~sommar/share_data.html
--Lenard
August 29, 2003 at 11:19 pm
fromnaija is quite right. There is no Global variables concept inbult in SQL Server. However, you can have a table in the master preferably or in the same database, where you can declare values against the variables and subsequently referening this table for desired values to us them in your Store procedures. I am using this logic in my applications.
September 2, 2003 at 1:08 pm
How about using a function?
RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply