Reputation: 835
I want to know is there a query or some SP to retrieve all the new rows added to my tables in my database. I am using SQL Server database.
Upvotes: 1
Views: 198
Reputation: 704
Change Data Capture
Change data capture is designed to capture insert, update, and delete activity applied to SQL Server tables, and to make the details of the changes available in an easily consumed relational format. The change tables used by change data capture contain columns that mirror the column structure of a tracked source table, along with the metadata needed to understand the changes that have occurred.
Change data capture is available only on the Enterprise, Developer, and Evaluation editions of SQL Server
http://msdn.microsoft.com/en-us/library/cc645858(v=sql.105)
Upvotes: 1
Reputation: 704
Configuring and Managing Change Tracking
Change tracking in SQL Server 2008 enables applications to obtain only changes that have been made to the user tables, along with the information about those changes. With change tracking integrated into SQL Server, complicated custom change tracking solutions no longer have to be developed.
Change tracking is an important building block for applications that synchronize and replicate data in scenarios in which end-to-end replication solutions do not work and a custom solution is required. For example, a scenario that requires synchronizing data with data stores that are not SQL Server databases or in which the store schemas are very different.
http://msdn.microsoft.com/en-us/library/bb964713(v=sql.105).aspx
Upvotes: 2