If you have control over the database table you are polling, add one more column of the type uniqueidentifier
. When doing your PollingDataAvailable statement, set a variable to newid()
and update the column with that ID + save it somewhere to read (preferably another table).
In your PollingStatement, you can read the last GUID from the separate table and only get what has been updated in your actual polling table + mark them as processed.
This way, no duplicates will be polled and you will get everything.
Also, if you have more than one BizTalk server in the group, consider separating a host, just for SQL polling and cluster that one (or put one active, the other passive). The way the polling works with multiple hosts sometimes makes it tricky to pick up records.
Hope this helps!