Error: Cannot insert duplicate key in object 'dbo.PA01221'

Find the sentence like "The duplicate key value is (PROJECT123 , 2016, 0)". Then run a query like:

 

delete from PA01221 where PAPROJNUMBER = 'PROJECT123' and YEAR1 = 2016 and PERIODID = 0

or for multiple periods:

delete from PA01221 where PAPROJNUMBER = 'PROJECT123' and YEAR1 = 2016 and PERIODID in (0,1,2,3)

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk