April 25, 2005 at 11:22 am
Can anyone think of a way I can cpature records that do not get loaded into my table using SQL.
I know I can use the the EXCEPTION File using DTS. I would like to use T-SQL
Example:
Record: A,B,C
If this record does not get loaded insert into an exception table.
THanks
April 25, 2005 at 11:54 am
It sounds to me as if there are two ways to understand this question.
The basic syntax would seem to me to be:
SELECT * FROM TableA WHERE TableA.IdentityField NOT EXISTS( SELECT TempTable.IdentityField FROM TempTable)
: where TempTable is the location of the newly loaded data.
1) See which records did not get loaded due to Business Rules not allowing them to load into TableA. If that is the question, then this syntax should work.
2) See which records did not get loaded into SQL Server due to data interpretation issues. If this is the question, then T-SQL will not answer your question. You cannot compare what is not there in the first place and you will need to rely on DTS.
I wasn't born stupid - I had to study.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply