Thursday, April 3, 2014

Best way to Share Data Between Stored Procedure and trigger

we have win application and when win application run then every user first login and then they can access any form from where they can insert or edit data through win UI.


when user delete data through our win apps then our win apps code execute the store proc and pass logged in user name. i am not talking about sql server user name.


so when store proc delete data from table then trigger fire and how can pass user name from store proc to trigger.


we can sort it through temp table as @David explain but there is one problem that is when my store proc will create a temp table with a name #user_data then another user who can create temp table with same name or another user may execute that same store proc as a result store proc will create a temp table with same name so then there will be a clash & problem. so i want to create a table with unique name for each sql server session. so please guide me. thanks


No comments:

Post a Comment