October 23, 2013 at 9:43 am
I would like to try and get the Rowversion change snuck into the schedule sometime soon.
An overview of this plan:
If we use the following command we can add a rowversion column to every table in both our main and settings databases.
EXEC sp_MSforeachtable '
if not exists (select * from sys.columns
where object_id = object_id(''?'')
and name = ''RowVersion'')
begin
ALTER TABLE ? ADD [RowVersion] Rowversion NOT NULL;
end';
With the rowversion column in place we can quickly check that data we are about to update is not stale, without having to read entire row into memory.
This is targeted more at disconnected/web service application contexts.
Entity Framework can be configured to take advantage of the column as well.
The plan was to add a one-time entry into the each of the update scripts to initialize this on all of the tables. And then add code to always run this command after main data or setting data updates are triggered (actually do something).
Any tips or best way to implement this???
October 23, 2013 at 10:06 am
Duplicate post. direct replies here. http://www.sqlservercentral.com/Forums/Topic1507706-2799-1.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply