title: How to log inserts, updates in SQL Server?
body: <p>I am wondering what would be the best practice to logging when a user inserts or updates some data from my ASP.NET application.</p>
  
  <p>In my application I need to know which user made the change, I think I have to options:</p>
  
  <blockquote>
    <ul>
    <li><p>Register my ASP.NET users into the SQL Server adding them the rights for the tables needed, and store for each of my users
    individual connectionstring. Thus I could use the currently logged in
    user's connectionstring when connecting to the database, so that I
    could write T-SQL triggers for SELECT and UPDATE.</p></li>
    <li><p>The other option I thought of is that I can write stored  procedures that get the ASP.NET user name as input parameter and makes
    the log for me, (I use only one connectionstring in the application).
    After modifying the database from the application I would call this
    procedure giving the currently logged in user's username.</p></li>
    </ul>
  </blockquote>
  
  <p>The second option seems simpler to me, but I think that for that purpose I should choose the first option.</p>