Oracle 10g2 offers DML error logging, which enables to load data with traditional SQL without having a complete roll-back in case one record is refused. http://orafaq.com/node/76
This is almost similar to loading capabilities of ETL-tools (at least in the error-handling department)
Does anyone have a clue whether Microsoft is going to add such functionality to SQL Server 2005?
I think you have that in SSIS, (almost 99% sure, so ask over there in their forum too http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=80&SiteID=1) but depending on the situation, you can do this easily in an instead of trigger, if you know the criteria to check for. Just something like the following in the insert trigger will do:
insert into exceptions (columns)
select columns
from inserted
where <bad data check>
insert into real table (columns)
from inserted
where not <bad data check>
This might be a solution for a table where the user is doing heads down keying of data.
Another alternative is to do the same thing in a procedure, if you are doing single row edits by using a TRY...CATCH block and inserting into the exception table on error.
Will they add something like this to 2005, no. But the next version? Perhaps, go here: https://connect.microsoft.com/SQLServer/Feedback and voice your opinion/idea for solution. If you do, post back here with the URL and request votes.
No comments:
Post a Comment