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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:03:06+00:00 2026-06-12T04:03:06+00:00

In examples on an optimistic approach, @version (for example as parameter in procedures) is

  • 0

In examples on an optimistic approach, @version (for example as parameter in procedures) is always in advance known.
Whether it is possible to receive @version in the procedure and on what it can affect.
Part of procedure:

CREATE PROCEDURE [dbo].[UpdateTestTable2]
...
SELECT @version = [version]
FROM dbo.TestTable2
WHERE Id = @Id

BEGIN TRANSACTION

UPDATE dbo.TestTable2
SET testName = @testName
WHERE Id = @Id AND [version] = @version
...
  • 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-12T04:03:07+00:00Added an answer on June 12, 2026 at 4:03 am

    The “version” needs to come from the app and reflects the version of the record that has been selected for update. This information is then included as part of the update to ensure that one is updating the same version of the record that is being “viewed”.

    This is what you seem to be doing by supplying some information from outside (in this case @id). But, as Igor points out, there is nothing magic about a column called “version”: you can drop your first select and leave the filter using @id.

    But…what you are missing is a simultaneous update of the version/id field. You should do smoething like this:

    update testtable2
    set versioning_column += 1
    where versioning_column = @versioning_column
    

    that way, you are updating exactly the column you intend to, but at the same time are precluding anyone else from doing so by changing the version stamp.

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

Sidebar

Related Questions

Examples of what you can do. (defmethod some-fn ((num real)) (print an integer)) (defmethod
All examples are taken from the SICP Book: http://sicpinclojure.com/?q=sicp/1-3-3-procedures-general-methods This was motivated from the
Can Castle ActiveRecord do optimistic locking on properties? I found optimistic locking for the
1) What is more appropriate/commonly used approach for concurrency control? Pessimistic or optimistic locking?
Examples I have seen .properties files with a convention similar to the following: Example
The examples in playframework seem to be lacking my example. The booking is the
I have some doubts about optimistic concurrency exception. Well, For example, I retrieve some
Examples first, questions second... Example 1) Non global match of '?sort=alpha&direction=asc' '?sort=alpha&direction=asc'.match(/([^?&=]+)(=([^&]*))?/); Output: //
Examples I find around the internet seem to use EGL10.EGL_NATIVE_RENDERABLE for the first parameter,
Examples: mapping a plural noun to its singular form: children --> child, boxes --->

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.