Questions tagged [rowversion]
91 questions
2
votes
0 answers
Update record based on rowversion value?
I have recently implemented SQL rowversion to prevent concurrency issues in my system. I use rowversion in where clause when updating single rows in the tables. So far I have tested and seems like a good solution. Now I'm looking for an easy way to…

espresso_coffee
- 5,980
- 11
- 83
- 193
2
votes
1 answer
DbEntityEntry OriginalValues vs. TryUpdateModel RowVersion to avoid concurrent updates (optimistic)
I am working on an ASP.NET MVC project with EF in C# from a book and this part is to avoid updating an entity concurrently from different sessions.
The book is great but unfortunately in this part the explanation is not sufficient and I would…

Somi
- 21
- 1
2
votes
0 answers
Timestamp on ASP.net core don't change rowVersion in database
I have that code:
public class BaseClass{
[ConcurrencyCheck]
[Timestamp]
public byte[] RowVersion { get; set; }
}
public class User : BaseClass
{
public string UserName { get; set; }
}
public class Context : DbContext{
public…

user6136000
- 115
- 1
- 7
2
votes
0 answers
When does the value for a rowversion column get updated?
If I have a table with a rowversion column and it gets updated as follows:
Name VersionStamp
Before update: Bob ABCD
After update: Dave EFGH
What happens if someone queries the table…

Señor Cardgage
- 93
- 2
- 8
2
votes
2 answers
Remove Entity Framework's extra lookup of RowVersion columns
I need to add a RowVersion column to all my tables. I need it for reasons like data warehousing (and similar DB only actions). I don't want to use it for concurrency.
I want Entity Framework to keep working as if the RowVersion column is not…

Vaccano
- 78,325
- 149
- 468
- 850
2
votes
2 answers
Is there an alternative to Microsoft.SqlServer.Management.Smo.SqlDataType that includes a value for RowVersion?
The Microsoft.SqlServer.Management.Smo.SqlDataType enum has a value for the timestamp type but not rowversion. I'm looking for an updated version of the assembly or an alternate enum type that supports it.
The existing enum has a value for…

Daniel Schaffer
- 56,753
- 31
- 116
- 165
2
votes
1 answer
Prevent rowversion (timestamp) column from changing ALTER TABLE COLUMN
I would like to run following command without Rowversion (timestamp) column values changed. I would like to achieve this both on SQL Server 2008 R2 and SQL Server CE 4.0.
ALTER TABLE MyTable
ALTER COLUMN TextColumn nvarchar(4000) --original size…

Vojtěch Dohnal
- 7,867
- 3
- 43
- 105
2
votes
1 answer
rowversion or doc version in mongodb
What would be a sound way to do row versioning in mongodb. Sql server had a rowversion field that got automatically incremented when a row got updated based on a relative time sql server tracked within the database. Wondering what a good scheme in…

govin
- 6,445
- 5
- 43
- 56
2
votes
1 answer
SQL server ROWVERSION definition is not accurate?
From msdn
Each database has a counter that is incremented for each insert or
update operation that is performed on a table that contains a
rowversion column within the database.
Also
To return the current rowversion value for a database, use…

Royi Namir
- 144,742
- 138
- 468
- 792
1
vote
2 answers
Is it possible to map SQL Server's rowversion type to something friendlier than byte[] using Entity Framework?
When I declare a SQL Server rowversion field in the Storage Model and let Entity Framework do its default mapping, the rowversion field is mapped to a byte array.
Is it possible to map it to a friendlier type (that would allow expressing equality…

Jean Hominal
- 16,518
- 5
- 56
- 90
1
vote
1 answer
Configure IsConcurrencyToken(value) with annotations in EF Core
I want to be able to use an attribute on a Row Version property of a model to enable or disable Optimistic Concurrency in the OnModelCreating(ModelBuilder modelBuilder) method of my DbContext in EF Core 7.0.0. I was able to make it work in .NET…

Zserbinator
- 365
- 2
- 10
1
vote
2 answers
How do I get the entity framework to stop setting the rowversion field?
Im using the Entity Framework and I have a rowversion (timestamp) field on a table to use for concurrency. However, when updating the entity object, it keeps trying to set the rowversion column to null, and I get an error:
The 'VerCol' property on…
John B
1
vote
1 answer
Why RowVersion datatype is missing inside SSMS
We have SQL server 2017, and we want to create a new field inside existing database
the field data type is RowVersion
but using the SQL Management Studio I can not define a field with RowVersion data type
we can use Timestamps
but per my knowledge…

John John
- 1
- 72
- 238
- 501
1
vote
2 answers
SQL RowVersion number columns for change tracking problem
I've got a situation where I am using a RowVersion columns and a Binary(8) columns to track whether a row has been changed.
Ideally whenever:
RowVersion != Binary(8)
Then there has been a change in that record. The real problem with this is that I…

SamuelWarren
- 1,449
- 13
- 28
1
vote
3 answers
EF4 with SQL Compact 4, rowversion doesn't update on save
I have a simple console app using SQL Compact 4.0 and entity frameworks 4. The database has a single table called Section which has three columns: Id (StoreGeneratedPattern: Identity, Type: Int32), Title (Type: string) and TimeStamp…

Darren
- 47
- 5