Home All Groups Group Topic Archive Search About

Global Property in SQL?

Author
8 Jun 2006 7:44 PM
rmg66
Here's one for you all....

[SQL Server 2000]

I need to somehow create a place (in memory?)  that will store a value.

This value needs to be visible to all sessions

BUT - it needs to die if and when the session that created it dies.

Because a session can die unexpectedly, I cannot rely on removing this "global property" programmatically.

I cannot use a standard table, because if the session dies the value will remain...

The closest I can come to is to create a temp object in tempdb and name that object the value of the "global property".
This way others could query tempdb..sysobjects and get the value -- and the object would die when the session does.
But I would hate to implement a hack like that.

There has got to be a better way!

BTW I have to do this in TSQL but if there an extended sp out ther that can help me....?

Haven't found anything in BOL

Author
8 Jun 2006 7:59 PM
Tibor Karaszi
Sound just like what a global ##temptable does...?

"rmg66" <rgwathney__xXx__primepro.com> wrote in message
news:O%23CrMPziGHA.412@TK2MSFTNGP05.phx.gbl...
Here's one for you all....

[SQL Server 2000]

I need to somehow create a place (in memory?)  that will store a value.

This value needs to be visible to all sessions

BUT - it needs to die if and when the session that created it dies.

Because a session can die unexpectedly, I cannot rely on removing this "global property"
programmatically.

I cannot use a standard table, because if the session dies the value will remain...

The closest I can come to is to create a temp object in tempdb and name that object the value of the
"global property".
This way others could query tempdb..sysobjects and get the value -- and the object would die when
the session does.
But I would hate to implement a hack like that.

There has got to be a better way!

BTW I have to do this in TSQL but if there an extended sp out ther that can help me....?

Haven't found anything in BOL
Author
9 Jun 2006 12:45 PM
rmg66
Thanks Anith,
Exactly what I was looking for.

Robert


Show quote
"Anith Sen" <an***@bizdatasolutions.com> wrote in message news:uUVZSlziGHA.1204@TK2MSFTNGP02.phx.gbl...
> See if this helps:
> http://groups.google.com/group/microsoft.public.sqlserver.programming/msg/b3266f08b19b10bd
>
> --
> Anith
>

AddThis Social Bookmark Button