I have the need to store the user information temporarily on SQL server to serve audit purpose. My idea is :
- because SQL can only audit changed data, but I also want to store user's information who made the changes, so I've to figure somethings out to achieve this
- when user log in to the application, create a local temporary table (#), name it after the user's current
SPID
, somethings like : #sp56, and store the information you need in there - when the audit triggers are fired, it will find the uses's nesscessary informations based on the
SPID
and fill the audit table with them - I also tried to audit the data in EF, but found it too complicated and not worthy to spend so much time in it
So my question is, is this possible using EF and SQL-Server? If there're any other better alternatives, I'm happy to hear!