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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:23:50+00:00 2026-05-12T10:23:50+00:00

My preliminary research says no. I have a database app in SQL Server that

  • 0

My preliminary research says “no”.

I have a database app in SQL Server that uses the SQL Server timestamp column for tracking changes…. that is, I can go through the table and know that if I see a timestamp > than some reference timestamp, that the row has been added or updated.

I’m looking for a type like that in MySQL. It doesn’t seem to exist. So, will I have to replicate this functionality using either triggers (good) or application logic (bad)?

Note that just using MySQL’s TIMESTAMP isn’t really a great solution, as it’s not always unique, and not monotonically increasing over time.

EDIT — here’s the scenario I’ve been using these for, for years…

I have a table in a OLTP system which is the current state of the inventory. I have a front end GUI that’s displaying different views of the inventory. I’d like to occasionally go and ask the DB “which rows are new/changed”. With SQL Server’s TIMESTAMP/ROWVERSION, I could do that easily. If I use an actual date type, I would always run into problems where I either got an update more than once (not a huge disaster), or occasionally missed an update (a disaster).

  • 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-05-12T10:23:51+00:00Added an answer on May 12, 2026 at 10:23 am

    I’m not sure I understand why this doesn’t work for your scenario. Is TIMESTAMP guaranteed to be unique in MS SQL Server?

    Aha — I see in SQL Server timestamp is a synonym for rowversion which is sort of like MySQL’s AUTO_INCREMENT except it generates a new monotonically increasing value on UPDATE as well as on INSERT.

    No, MySQL doesn’t have anything like this. Nor does MySQL support a SEQUENCE object like Oracle or PostgreSQL or IBM DB2. A sequence would allow you to generate a new value from a trigger, for instance.


    I read your updated info in your question, so I understand the problem you are trying to solve.

    What I have seen as an alternative solution is to add another attribute in the table you’re processing, call it is_processed or something. Enter a NULL when you insert a new row. When you get around to processing it, change the value in that column to 1. Then you’ll always know which rows you have yet to process — they’ll be the rows where is_processed IS NULL.


    Re your comment: Okay, I see the problem. Each user needs their own view of which rows are new/changed.

    Another hack I’ve seen used in MySQL to simulate a sequence object is a table that contains an auto-increment primary key and nothing else. You can generate new unique monotonically increasing values by inserting into this table, and then roll back the insert.

    CREATE TABLE sequence (id SERIAL) ENGINE=InnoDB; -- Must be InnoDB
    
    START TRANSACTION;
    INSERT INTO sequence () VALUES (); -- Yes this is a legal statement.
    ROLLBACK;
    
    SELECT LAST_INSERT_ID();
    

    You can’t start and rollback transactions within a MySQL trigger, so you’ll have to generate the new values in your application code.

    Or else you could switch to PostgreSQL, and get real support for sequences.

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

Sidebar

Ask A Question

Stats

  • Questions 231k
  • Answers 231k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the following function like this: Image('/path/to/original.image', '1/1', '150*', './thumb.jpg');… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer Check you database schema to see if the field (referenced… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer I figured out the problem - there was a session… May 13, 2026 at 2:13 am

Related Questions

I am sorry in advance if my question sounds too generic - I am
This is a long text. Please bear with me. Boiled down, the question is:
I'm playing around with the IMAP protocol in PHP using fsockopen to send and
Are there any reference patterns for .Net server applications relating to storing and retrieving

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.