Questions tagged [rowversion]
86 questions
27
votes
8 answers
SQL Server RowVersion/Timestamp - Comparisons
I know that the value itself for a RowVersion column is not in and of itself useful, except that it changes each time the row is updated. However, I was wondering if they are useful for relative (inequality) comparison.
If I have a table with a…
David Pfeffer
- 36,331
- 28
- 120
- 198
26
votes
2 answers
MVC3 - posting byte array to a controller - Database RowVersion
I am working on an MVC3 application. My client side ViewModel contains a SQL Server RowVersion property, which is a byte[]. It is rendered as an Object array on the client side. When I attempt to post my view model to a controller, the RowVersion…
Garry English
- 4,722
- 1
- 32
- 22
21
votes
10 answers
How to query Code First entities based on rowversion/timestamp value?
I've run into a case where something that worked fairly well with LINQ to SQL seems to be very obtuse (or maybe impossible) with the Entity Framework. Specifically, I've got an entity that includes a rowversion property (both for versioning and…
Sixten Otto
- 14,750
- 3
- 46
- 60
18
votes
3 answers
SQL Server : RowVersion equivalent in Oracle
Does Oracle has similar datatype to SQL Server's RowVersion?
When you insert or update a row, the corresponding Version column(which is of type RowVersion) gets updated automatically.
MSDN says about RowVersion:
Is a data type that exposes…
Falaque
- 856
- 2
- 12
- 26
16
votes
1 answer
SQL MIN_ACTIVE_ROWVERSION() value does not change for a long while
We're troubleshooting a sort of Sync Framework between two SQL Server databases, in separate servers (both SQL Server 2008 Enterprise 64 bits SP2 - 10.0.4000.0), through linked server connections, and we reached to a point in which we're sort of…
luiggig
- 231
- 1
- 9
15
votes
4 answers
converting sql server rowversion to long or ulong?
What is the proper type for the rowversion (timestamp) data type?
I know it is 8 bytes but i cannot find a link in MSDN which tell if it is a signed or unsigned long.
which code should I use, does it even matter?
byte[] SqlTimeStamp;
long…
Fredou
- 18,946
- 9
- 53
- 107
12
votes
6 answers
How to read timestamp type's data from sql server using C#?
I get the result in .NET like this:
var lastRowVersion = SqlHelper.ExecuteScalar(connStr, CommandType.Text, "select
top 1 rowversion from dbo.sdb_x_orginfo order by rowversion desc");
The result is a byte array [0]=…
user980447
- 123
- 1
- 1
- 5
10
votes
3 answers
Rowversion comparison in Entity Framework
How should I compare rowversion fields using Entity Framework? I have one table which has a rowversion column, I want to get data from tables for which the row version is higher than specified value.
byte[] rowversion = ... some value;
…
bhavesh lad
- 1,122
- 1
- 11
- 23
9
votes
2 answers
Does rowversion/timestamp affects performance significantly?
I plan to add to most tables in my DB rowversion to track changes in those tables. I know that adding it will affect performance of queries.
Does anyone knows if it affect performance a little bit (few percent slower) or I should not to add…
Marek Kwiendacz
- 8,844
- 14
- 44
- 72
8
votes
3 answers
Is rowversion not a valid data type in SQL Server 2008 R2?
Is rowversion not a valid data type in Microsoft SQL Server 2008 R2?
Bonus Chatter
i'm trying to add a rowversion column to a table:
But when i try to leave the "Data Type" column, SQL Server Management Studio complains
Invalid data type.
and…
Ian Boyd
- 220,884
- 228
- 805
- 1,125
7
votes
2 answers
RowVersion implementation on Entity Framework for PostgreSQL
I am using Entity Framework 6 with PostgreSQL.
I have an entity in which I want to prevent concurrency issues, following this documentation I added a RowVersion property with [Timestamp] attribute, however after saving changes to the entity the…
Silvano González
- 311
- 3
- 11
7
votes
2 answers
T-SQL "timestamp" overwrites "rowversion" data type column
I am using Miscrosoft SQL Server 2012 and because in this article is said:
The timestamp syntax is deprecated. This feature will be removed in a
future version of Microsoft SQL Server. Avoid using this feature in
new development work, and plan…
gotqn
- 36,464
- 39
- 145
- 218
6
votes
2 answers
How to update a record without changing rowversion
If a table has a rowversion column in it and you make an update to that row, the value of the rowversion column increases. I know that this is by design and the purpose of rowversion columns, however is there any way to make it such that an update…
wnka
- 202
- 1
- 5
- 10
5
votes
2 answers
Adding a nullable rowversion column to a table
I'll keep this short and sweet. I am trying to add a column of type rowversion to an existing table. My thought was that by adding it as NULL, existing rows wouldn't be stamped with a timestamp, but alas they were. If that is the behavior, in what…
Ben Thul
- 27,049
- 4
- 40
- 62
5
votes
2 answers
Is there a possible race condition in this UPDATE statement?
I'm writing a synchronizer software which will take all changes in one DB and synchronize them to another DB. To this end I've added in my table T two columns:
alter table T add LastUpdate rowversion, LastSync binary(8) not null default 0
Now I can…
Vilx-
- 97,629
- 82
- 259
- 398