Keep SQL Script Running

  • in sql server 2005 how can i keep running series of sql statements when there is an error. I have a file where 15000+ lines and just need to find the errors but with it stopping every few seconds this is taking forever. already over 8 hrs.

    This is for test purposes only. the final clean file will be run in production.

    Got any thoughts??

  • SSIS. Output error rows to a separate table.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • SSIS is the nicest solution, but probably requires you to learn more than you would want for a test.

    If what you're doing is essentially running a block of code in a loop, then you can nest your loop in a TRY-CATCH block, like so:

    BEGIN TRY

    END TRY

    BEGIN CATCH

    [report error]

    END CATCH

    If what you're trying to do is look through a set of data and find rows which are causing errors, you could probably do that by writing a SELECT clause and have one of the fields returned contain a code for whether the row has an error in it.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply