stored procedure error

  • I'm new to sql moving from access. I've created a sproc which works but returns a error message :

    Server: Msg 3604, Level 16, State 1, Procedure p_insertmonths2, Line 14

    Duplicate key was ignored.

    Is there any way you can stop the message seeing that it does insert data in to the table.

    Thanks

    SQL convert

     

     

  • The error is telling you there is a problem with your data.  You are trying to insert Primary Key violations into the system which SQL is politely telling you it won't do.

    What you can do is look at NOT EXISTS or LEFT JOIN for your INSERT statement and only INSERT data you need.  This is a common issue (our batch process goes through it multiple times daily )



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

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

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