I need to know which are the tables changed in the database using change tracking. Is there any table where i can find the last updated tables with the commit id?
I can use select * from CHANGETABLE(CHANGES taitemnames,25262)ct order by sys_change_version desc
but this requires me to run it once for every table to check for changes.
标签:
sql-server-2008
相关问题
- SQL to Parse a Key-Value String
- How to evaluate an input in the WHERE clause
- employee id automatic generate with prefix
- update user details, sql server 2008 sqlsrv
- Calculating the 95th Percentile value?
相关文章
- Code for inserting data into SQL Server database u
- SQL Server 2008 Change Data Capture, who made the
- How do we alias a Sql Server instance name used in
- How to do a UNION on a single table?
- SQL Group by Count of Counts
- SQL Server drop and recreate indexes of a table
- How to generate sequential row number in tsql?
- Pass table as parameter to SQLCLR TV-UDF
I'm not familiar with this feature, but if your issue is how to query multiple tables using
CHANGETABLE()
then I assume you could use a stored procedure to loop over all table names and run the query using dynamic SQL:You could combine this with an
INSERT
in the dynamic SQL to write the results into a table that you then query for reporting and analysis.Try
sys.CHANGE_TRACKING_TABLES
(documented on MSDN here).You'll have to use
OBJECT_NAME
to get the table name from the first column.