Hi all,
we have this situation on migration database.
With NAV 2009 we have SQL triggers to manage changes that could be replicated on other databases. And we have USERID from navision because our customer uses Classic client.
On nav 2015 with RTC we have the problem that the same triggers works fine but the user is always the user that start services.
How can we know who is the user that run this triggers from SQL?
Thanks in advance for your help
0
Comments
I heard that someone made somthing I think in DOTNET to catch the user before the transaction starts. Still have to look at that solution.
SELECT ORIGINAL_LOGIN() as A,
SUSER_NAME(SUSER_ID()) as B,
SUSER_SNAME(SUSER_SID()) as C,
SYSTEM_USER as D,
CURRENT_USER as E,
USER_NAME(USER_ID()) as F,
SESSION_USER as G,
USER as H
INTO TablaT
And all results are the same, the user that start service.
We try with ssesion Id and table active session in nav, but the Id session in nav is not the same that SQL.
1. Create a sql view to let Nav know the current sql process id 2. Create the linked sys_ConnectionProperties table in Nav.
3. Write a function to link the current Nav user to a server process id using an additional table. 4. insert a function call in most suitable place - OnLoginStart or OnGlobalModify .
5. Modify SQL triggers.
6. Optimize the function - it's enough to modify serverProcesses table once per session .
Nav, T-SQL.
it works with little adjustments but the idea is great =D>