Thanks, Andre
However, the real solution is to avoid using IGNORE_DUP_KEY and to properly code your SQL code to avoid duplicates (for
example, using a predicate with NOT EXISTS to insert only keys that do not exist in the table).
--
Plamen Ratchev
http://www.SQLStudio.com
Andre
But on SQL 2000 the message is raised with level 16 - without setting
@@error.
Andr� mentioned DTS, maybe DTS thinks it's an error too. In that
case, more orthodox coding is to recommend. (Personally, I don't
use IGNORE_DUP_KEY very often, but I did just it in a UDF that I
posted recently, because I needed to make sure that the UDF returns
unique values, but I knew the duplicates would only be occasional.)
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
I have never used IGNORE_DUP_KEY in production code. Much better to code the SQL statements correct.