Reputation: 8104
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 2000
Columns in MyTable
Version rowversion NOT NULL
TextColumn nvarchar(2000) NOT NULL
No data in MyTable
. TextColumn
change by running this command, still all the rowversion
values are updated, which is definitely not the expected behavior.
Is this possible or is there any workaround?
Edit:
To make it more clear I should add that the my purpose is to distribute db structure updates in a synchronized environment, where the server is SQL Server 2008 R2 and sync clients are SQL CE 4.0.
Edit 2: This problem is present only on SQL Compact. On normal SQL Server it works as expected.
Edit 3: Filled as a bug on Microsoft Connect: https://connect.microsoft.com/SQLServer/feedback/details/816991/unexpected-sql-ce-4-0-rowversion-value-behavior-with-alter-column
Upvotes: 2
Views: 1815
Reputation: 41819
I am able to repro your issue, and do not know of any workaround. One option would be to rely on something else than rowversion values for sync purposes.
Upvotes: 2