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

  • Home
  • SEARCH
  • 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 582137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:39:17+00:00 2026-05-13T14:39:17+00:00

I have an sql server table with a timestamp column. Is there a way

  • 0

I have an sql server table with a timestamp column. Is there a way to force the timestamp column to change without an actual update of the record?

The reason I am asking is because I want the record’s timestamp to change when a record is inserted/updated/deleted in a child table.

Timestamp may not be the best way to go about doing this. If not, what should I do? I don’t want to use datetime because I don’t feel that’s a good way of versioning. I don’t want to use an integer, because I don’t want to have to read the value to increment it.

Suggestions?

  • 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-13T14:39:18+00:00Added an answer on May 13, 2026 at 2:39 pm

    I don’t want to use an integer, because I don’t want to have to read the value to increment it.

    UPDATE Table SET
        IntColumn = IntColumn + 1
    

    While that does technically require a read, I don’t see any problems with it.

    You could always just update to the same value:

    UPDATE Table SET
        SomeColumn = SomeColumn
    

    which will trigger rowversion update as well.

    ADDITION: You could do a view with the max rowversion of the children:

    SELECT Parent.*, MaxChildRowVersion as ChildVersion
    FROM Parent
    JOIN (
        SELECT ParentId, MAX(RowVersion) as MaxChildRowVersion
        FROM Child
        GROUP BY ParentId
    ) as Child ON
         Parent.ParentId = Child.ParentId
    

    But, no, you can’t directly update a rowversion column (though you could implement your own updatable with @@DBTS, binary(8) and INSTEAD OF triggers…)

    Could you give examples of your last point? It sounds promising.

    No, really it doesn’t. 😉 It’s too much work when you could just update to the same value instead or use a view. Those are the 2 easiest options.

    But, to be complete, a binary(8) column with a default of @@DBTS (which returns the database version number), and an AFTER UPDATE trigger that also updates the binary column to the new @@DBTS will give you a psuedo-rowversion type that you can then update manually. It’d be no faster or better than just updating some other column to it’s same value though.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If I recall, you can use vbMsgBoxHelpButton to add a… May 13, 2026 at 4:20 pm
  • Editorial Team
    Editorial Team added an answer NSThread does not expose a Join method by any name.… May 13, 2026 at 4:20 pm
  • Editorial Team
    Editorial Team added an answer The problem is the solution has lost its binding. That's… May 13, 2026 at 4:20 pm

Related Questions

My preliminary research says no. I have a database app in SQL Server that
I've just started learning how to use the Entity Framework to write a very
I'm using MySQL (nobody's perfect), version 4.1 and I'm used to define some timestamp
I have a table in SQL Server that stores statistics for a piece of
I have a table delivery_history which is populated by a trigger: id(guid) order_number delivery_number

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.