Re: Is it possible to create a custom SQL session function/variable
- From: "Dan Guzman" <guzmanda@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 14 Jul 2007 11:03:40 -0500
Take a look at SET CONTEXT_INFO in the Books Online. That allows you to set a value for the connection that is accessible anywhere in the session with the CONTEXT_INFO function. Since the value is binary, you'll need to convert as needed.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"GMG" <gmgsoftware@xxxxxxxxxxxxx> wrote in message news:%23cNc2ceuHHA.3376@xxxxxxxxxxxxxxxxxxxxxxx
To avoid having to pass this user specific ID via a parameter in the stored
procedure, is it possible to create your own function like (like
suser_sid()) or variable (like @@SPID) ?
This value would be passed from a Web Service (asp.net 2.0) in the
connection string or something and could be referred to anywhere in the SQL
code (SQL 2005).
Has anyone got a better solution than a SP parameter ?
.
- Prev by Date: Re: Determining permissions through Stored Procedures
- Next by Date: Is it possible to read/write a file at privilege?
- Previous by thread: Re: Execute Permission for Database Role
- Next by thread: Is it possible to read/write a file at privilege?
- Index(es):
Relevant Pages
|
|