I would like to add change tracking and change data capture in the same table for SQL Server 2017 (v14.0.3030.27). When I enabled Change tracking it worked, also when I enabled Change data capture, it worked well.
But when I enabled both at the same time in the same table, I'm not getting values of change data capture. couldn't see any documentation saying it so.
My plan is to pull the change using Change tracking and fetch the details from Change Data capture table. Any thoughts?
Given your extra information "But my aim is to poll a small table every minute (if possible seconds)", I would suggest using SqlDependency
to be notified when data changes rather than continuously polling.
SqlDependency is ideal for caching scenarios, where your ASP.NET application or middle-tier service needs to keep certain information cached in memory. SqlDependency allows you to receive notifications when the original data in the database changes so that the cache can be refreshed.
To set up a dependency, you need to associate a SqlDependency object to one or more SqlCommand objects. To receive notifications, you need to subscribe to the OnChange event. For more information about the requirements for creating queries for notifications, see Working with Query Notifications.
With the caveat:
SqlDependency was designed to be used in ASP.NET or middle-tier services where there is a relatively small number of servers having dependencies active against the database. It was not designed for use in client applications, where hundreds or thousands of client computers would have SqlDependency objects set up for a single database server.