Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9133955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:34:40+00:00 2026-06-17T08:34:40+00:00

suppose i am calling a Stored Procedure and sending some params. the Stored Procedure

  • 0

suppose i am calling a Stored Procedure and sending some params. the Stored Procedure will update a table and a trigger is there for that table. so when Stored Procedure update table then i want which user is updating the table but i am not using sql server user name rather i will send user names to SP who will update the table. so before update i can store that user name in local temp table and query that local temp table from trigger to get that user name. i hope it is possible but i want to other good option to achieve this job. so please share idea. thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:34:40+00:00Added an answer on June 17, 2026 at 8:34 am

    You can encode the user name in the procedure into the session using SET CONTEXT_INFO
    This can be read in the trigger by CONTEXT_INFO

    This is concurrency safe: each session/call is isolated from any other.
    And no need for a temp table or such.

    DECLARE @context varbinary(100) = CAST('foobar' AS varbinary(100));
    
    SET CONTEXT_INFO @context;
    
    SELECT CAST(CONTEXT_INFO() AS varchar(100));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a some stored procedure that called like: search('foo bar') makes a search
Suppose you're calling a Win32 function that will fill in your byte array. You
Suppose you are calling a function, where there's clearly a need to break down
I have a stored procedure that inserts batches of millions of rows, emerging from
Does calling one stored procedure from within another stored procedure impact performance at all?
Suppose the following table structure: Event: id: integer start_date: datetime end_date: datetime Is there
Let's assume, we create a stored procedure that is supposed to retrieve customer details
Is there any feature of asynchronous calling in PL/SQL? Suppose I am in a
Suppose I am calling a query SELECT name, city, country FROM People. Once I
Suppose I have a pure virtual method in the base interface that returns to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.