I am working with loading XML files contents into a table in a SQL Server database, for which I wanted to delete the contents of a table dbo.Accounting
in the SQL Server database, which has APC_PK_ID
as its primary key, and then load back its contents from the xml file.
But there was this message that showed up saying:
The DELETE statement conflicted with the REFERENCE constraint "FK__Inventori__Accou__29CC2871". The conflict occurred in database "PAModel", table "dbo.Inventories", column 'APC_PK_ID'. The statement has been terminated.
So now I figured out that I had to delete the column contents of APC_PK_ID
from dbo.Inventories
table separately.
But the point of concern for me is, is it possible to restore back the contents of APC_PK_ID
in the dbo.Inventories
table, as it was before deletion?
Will there be any data loss or problem in loading the data back, if there happens to be a method?
Thank you for checking into the question.