I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little static shared variable here and there without having t - CSharp

This is a discussion on I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little static shared variable here and there without having t - CSharp ; I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little static shared variable here ...

+ Reply to Thread
Results 1 to 4 of 4

I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little static shared variable here and there without having t

  1. Default I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little static shared variable here and there without having t

    I heard there is some trick to referencing statics in C# CLR stored
    procedure without having to mark the assembly as unsafe. Does anyone know
    this? This is usefull as the case of needing a little static shared variable
    here and there without having to compromise safety in the Sql Server 2005.



  2. Default Re: I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little static shared variable here and there without havi

    "DR" <softwareengineer98037@yahoo.com> wrote in message
    news:eUZq30mGIHA.1548@TK2MSFTNGP05.phx.gbl...
    >I heard there is some trick to referencing statics in C# CLR stored
    >procedure without having to mark the assembly as unsafe. Does anyone know
    >this? This is usefull as the case of needing a little static shared
    >variable here and there without having to compromise safety in the Sql
    >Server 2005.
    >


    Never heard of such "trick", anyway, if such trick would exist, it would
    compromise SQL Server's safety, also it makes little sense to rely on
    statics in this environment, the statics will get re-initialized after an AD
    reload. Your best bet is to save shared values in the database.

    Willy.



  3. Default Re: I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little static shared variable here and there without havi

    shared values in db is not acceptable when i need to store then in a memory
    resident hash table with no extra fat.

    "Willy Denoyette [MVP]" <willy.denoyette@telenet.be> wrote in message
    news:O5E8xUnGIHA.2328@TK2MSFTNGP03.phx.gbl...
    > "DR" <softwareengineer98037@yahoo.com> wrote in message
    > news:eUZq30mGIHA.1548@TK2MSFTNGP05.phx.gbl...
    >>I heard there is some trick to referencing statics in C# CLR stored
    >>procedure without having to mark the assembly as unsafe. Does anyone know
    >>this? This is usefull as the case of needing a little static shared
    >>variable here and there without having to compromise safety in the Sql
    >>Server 2005.
    >>

    >
    > Never heard of such "trick", anyway, if such trick would exist, it would
    > compromise SQL Server's safety, also it makes little sense to rely on
    > statics in this environment, the statics will get re-initialized after an
    > AD reload. Your best bet is to save shared values in the database.
    >
    > Willy.
    >
    >




  4. Default Re: I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little static shared variable here and there without havi

    What kind of value do you need to store? A value in the database might
    be the only option here. If you want to reduce the overhead of having to
    query the database from inside the CLR stored procedure, do the query for
    the value outside of the CLR stored procedure (in a wrapper) and then pass
    your static value in (perhaps make it an output variable if the value needs
    to be set).


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard.caspershouse.com

    "DR" <softwareengineer98037@yahoo.com> wrote in message
    news:O8o2qDoGIHA.1212@TK2MSFTNGP05.phx.gbl...
    > shared values in db is not acceptable when i need to store then in a
    > memory resident hash table with no extra fat.
    >
    > "Willy Denoyette [MVP]" <willy.denoyette@telenet.be> wrote in message
    > news:O5E8xUnGIHA.2328@TK2MSFTNGP03.phx.gbl...
    >> "DR" <softwareengineer98037@yahoo.com> wrote in message
    >> news:eUZq30mGIHA.1548@TK2MSFTNGP05.phx.gbl...
    >>>I heard there is some trick to referencing statics in C# CLR stored
    >>>procedure without having to mark the assembly as unsafe. Does anyone know
    >>>this? This is usefull as the case of needing a little static shared
    >>>variable here and there without having to compromise safety in the Sql
    >>>Server 2005.
    >>>

    >>
    >> Never heard of such "trick", anyway, if such trick would exist, it would
    >> compromise SQL Server's safety, also it makes little sense to rely on
    >> statics in this environment, the statics will get re-initialized after an
    >> AD reload. Your best bet is to save shared values in the database.
    >>
    >> Willy.
    >>
    >>

    >
    >



+ Reply to Thread

Similar Threads

  1. Replies: 3
    Last Post: 11-08-2007, 01:34 PM
  2. Replies: 1
    Last Post: 11-06-2007, 09:50 PM
  3. Replies: 1
    Last Post: 10-30-2007, 06:25 AM
  4. Replies: 0
    Last Post: 10-29-2007, 03:48 PM
  5. Replies: 0
    Last Post: 10-29-2007, 03:48 PM