0

Having such situation - launching a code at the end of night which inserts records and once a while it appears duplicate unique key which causes a RAISERROR block to appear with error that cannot insert duplicate keys and then it stops procedure till this part is not fixed.

It is possible to have these critical errors in a log file only, but it will proceed further with other good lines and finish procedure?

orangutangas
  • 391
  • 2
  • 7
  • 20
  • 3
    Possible duplicate of [How to Ignore "Duplicate Key" error in T-SQL (SQL Server)](https://stackoverflow.com/questions/1139050/how-to-ignore-duplicate-key-error-in-t-sql-sql-server) – Dale K Feb 22 '19 at 05:55
  • thank you, duplicate key is only one of errors- there can be more of them criticals, i gave that one as an example – orangutangas Feb 22 '19 at 06:04
  • 1
    Did you read it? The same principle applies to all errors. – Dale K Feb 22 '19 at 06:05
  • An ETL tool like SSIS can do this. Simpler approaches are to pre-screen your rows for the most common problems. – SMor Feb 22 '19 at 13:15

0 Answers0