Questions tagged [rowversion]

86 questions
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
  • 95
  • 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…
2
votes
2 answers

rowVersion gets mapped to byte[8] in Entityframe work but when manually casting it's byte[18]

I am getting rowVersion from database as byte[8] var rowVersion= new MyContext().Employee.FirstOrDefault(x => x.Id).rowVersion; // suppose above the actual databse values is 0x0000000000038B8C var rowVersionToLong =…
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…
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
  • 52,912
  • 28
  • 108
  • 161
2
votes
2 answers

How do I store a rowversion values in a table that already has a rowversion column?

I have a two tables (Users, DeletedUsers) and a trigger Users_Delete. When a user record is deleted I want to store the id and the last rowversion value (before it was deleted) in the DeletedUsers table. Because SQL does not allow multiple columns…
Gene C
  • 1,940
  • 26
  • 31
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,154
  • 2
  • 36
  • 91
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
  • 5,857
  • 5
  • 35
  • 54
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
  • 131,490
  • 121
  • 408
  • 714
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
  • 15,333
  • 4
  • 51
  • 85
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
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,429
  • 12
  • 27
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…
1
vote
0 answers

C# optimistic concurrency no respond

I'm trying to add optimistic concurrency to my application by following this tutorial. Unfortunately the app works as if I haven't changed anything. I open two browsers, in both I edit the same line, overwrite the same value and put it at the first…
1
vote
1 answer

Converting binary value to string and back to binary?

I have rowversion value that comes from Database in binary format. I need to convert that value to string in order to pass in my front-end code. Then when user submits data back to the server I need to convert that string back to binary. Here is…
espresso_coffee
  • 5,076
  • 9
  • 53
  • 124