In SQL server, there are times when I have a variable which may change, that many stored procedures all use and just think it would be cool if I could store it as an ‘@@variable’ (like @@servername).
Is it possible to create your own ‘@@variable’? And if so, how do you do it?
(using sql server 2008)
I’d go with using a real table to hold your global values, then it’ll survive between restarts/connections. There is a good example of that here: http://weblogs.sqlteam.com/mladenp/archive/2007/04/23/60185.aspx