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 9277969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:14:38+00:00 2026-06-18T17:14:38+00:00

I would like to create a little auditing mechanism for my tables in sqlite

  • 0

I would like to create a little auditing mechanism for my tables in sqlite where any time a change is made to a table, i update 2 fields that show who changed the data and when.
We use a similar concept in our MS SQL Server databases.
But I’m wondering how I could implement this in sqlite. I’ve added 2 fields to the end of my table called updatedusername, and a updateddatetime field.
When end users sign into my web application and make changes, i can “insert” the user credentials along with any other data for the specific table…
But i’m wondering how i could accomplish the same thing with triggers.
Can anyone shed some light on this?
For example, if i were to set up a trigger, when a new record is inserted or existing data is updated, how would I supply the username of the person that logged into the app to make the change, instead of some generic web id that’s being used by my server….

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-18T17:14:39+00:00Added an answer on June 18, 2026 at 5:14 pm

    SQLite doesn’t have the notion of users you’ll find in other databases, which means there’s no way to ask what user initiated an operation.

    If the client has a user name on hand, you would have to make sure that every INSERT and UPDATE provided it:

    CREATE TABLE foo ( bar INTEGER, baz INTEGER, whodunnit TEXT );
    
    INSERT INTO foo VALUES (1, 123, 'bob');
    UPDATE foo SET baz = 1, whodunnit = 'bob' WHERE bar = 123;
    

    The time can be filled in automatically by a trigger since SQLite has functions that can provide that information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

idea I would like to create a little app for myself to store ideas
I would like to create a little game where user would simply move some
I would like to create a class that effectively does this (mixing a little
Helo everyone I've create simple page with table and would like populate it with
I would like to create a little application that plays back a music file
I would like to create a page a little like the Grouped Items Page
I have a temp table that stores rollup data and would like to create
This one is a little tricky to explain. I would like to create a
I would like to create a little application for iPhone or Android smart phones.
i would like create a array of structure which have a dynamic array :

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.