Questions tagged [rowversion]

91 questions
30
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
  • 38,869
  • 30
  • 127
  • 202
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
  • 5,070
  • 1
  • 36
  • 23
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,816
  • 3
  • 48
  • 60
21
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
  • 886
  • 2
  • 12
  • 27
19
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
  • 19,848
  • 10
  • 58
  • 113
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…
13
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
  • 133
  • 1
  • 1
  • 5
12
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,242
  • 1
  • 13
  • 23
11
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…
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
  • 9,524
  • 14
  • 48
  • 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
  • 246,734
  • 253
  • 869
  • 1,219
8
votes
2 answers

Does MySQL have an equivalent of SQL Server rowversion?

I am migrating a SQL Server database schema over to MySQL. Some of the tables on SQL Server have a column of type rowversion. This is an integer value that is set when the row is first inserted and then again each time any column of the row is…
Phil Wright
  • 22,580
  • 14
  • 83
  • 137
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
  • 42,737
  • 46
  • 157
  • 243
6
votes
2 answers

Proper RowVersion simulation in SqLite with conversion to ulong on Entity Framework Core

I'm trying to make RowVersion work properly both on SqLite and SqlServer with easy query on the rowversion column. To be able to do that I need to convert the rowversion column to ulong instead of byte[] and still have it work properly. public…
6
votes
3 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
  • 31,080
  • 4
  • 45
  • 68
1
2 3 4 5 6 7