Showing posts with label deleted. Show all posts
Showing posts with label deleted. Show all posts

Friday, March 23, 2012

Last time a table was updated - SQL 2005

How can one determine the last time when records have been inserted,
updated or deleted for a table?
Thanks.Hi
Tony has posted this sometime ago
In SQL Server 2005 you can use the sys.dm_db_index_usage_stats data
management view, look at the column last_user_update, you can also see when
the table was last accessed (last_user_seek and last_user_scan - do a MAX on
them).
select *
from sys.dm_db_index_usage_stats
where database_id = db_id( 'readpasttest' )
<Wing9897@.hotmail.com> wrote in message
news:1190639143.805215.112750@.d55g2000hsg.googlegroups.com...
> How can one determine the last time when records have been inserted,
> updated or deleted for a table?
> Thanks.
>|||Wing,
The sys.dm_db_index_usage_stats is very helpful in an ongoing operational
period, e.g. answering questions such as whether the table had been updated
in the last hour.
However, if you have tables that are only updated rarely such as every few
weeks or month, this is probably not the answer for you. These counters are
initialized to empty whenever SQL Server service is restarted. Also, a
database detach or Auto-close removes the rows for that database.
RLF
<Wing9897@.hotmail.com> wrote in message
news:1190639143.805215.112750@.d55g2000hsg.googlegroups.com...
> How can one determine the last time when records have been inserted,
> updated or deleted for a table?
> Thanks.
>

Monday, February 20, 2012

Large delete stmt - 2nd question

Publisher has delete stmt executed against transactionally replicated table.
270K rows deleted in 1 stmt.
1 Subscriber connected with T1
How best to replicate all the 270K simpleton delete calls to
sp_MSdel_tablename at subscriber through distr agent? What parameter
adjustments to make?
Changed -CommitBatchSize to 1000, doesn't seem to increase speed much...
Thanks,
Chris
Set HistoryVerboseLevel to 0, CommitBatchSize to 1000 and
CommitBatchThreshold 10000
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:DED73E09-DA75-444C-8976-96FF475B9567@.microsoft.com...
> Publisher has delete stmt executed against transactionally replicated
table.
> 270K rows deleted in 1 stmt.
> 1 Subscriber connected with T1
> How best to replicate all the 270K simpleton delete calls to
> sp_MSdel_tablename at subscriber through distr agent? What parameter
> adjustments to make?
> Changed -CommitBatchSize to 1000, doesn't seem to increase speed much...
> Thanks,
> Chris