It seems like a fairly simple problem but unable to figure out what the problem is as my brains are fried.
I have a stored procedure which will first delete all the rows and then insert rows into them.
The problem i am facing is that if there are rows already in the table, I get an exception from the application i am trying to run this stored procedure.
I have attached the exception and the sql query.
As a test i had a couple of rows in the table and I was trying to delete it and re-insert the same rows into the table. Since i am trying to re-insert the same rows I get primary key violation exception. Not sure where i am going wrong.
Hoping for some help.