Hello. I have these few Delete Statements below. I then get the server message below the code. Below the Server Message, I have listed the actual Foreign Key Constraint. Is there any way to actually Process the Delete Statements with the Foreign Key Constraint enabled? And, how would I do so programmatically? Please let me know your ideas. Thank you very much. Take care.
DELETE FROM HS_EVENT
WHERE HSE_ID <= (SELECT MAX(EVENTID)FROM FINALTABLEMERGE)
DELETE FROM HS_STRING_PARAMETER
WHERE HSPS_E_ID <=(SELECT MAX(EVENTID) FROM FINALTABLEMERGE)
Server: Msg 547, Level 16, State 1, Line 5
DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_HS_STRING_PARAMETER_HS_EVENT'. The conflict occurred in database 'STATS', table 'HS_STRING_PARAMETER', column 'HSPS_E_ID'.
The statement has been terminated.
"FK_HS_STRING_PARAMETER_HS_EVENT"
DELETE FROM HS_EVENT
WHERE HSE_ID <= (SELECT MAX(EVENTID)FROM FINALTABLEMERGE)
DELETE FROM HS_STRING_PARAMETER
WHERE HSPS_E_ID <=(SELECT MAX(EVENTID) FROM FINALTABLEMERGE)
Server: Msg 547, Level 16, State 1, Line 5
DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_HS_STRING_PARAMETER_HS_EVENT'. The conflict occurred in database 'STATS', table 'HS_STRING_PARAMETER', column 'HSPS_E_ID'.
The statement has been terminated.
"FK_HS_STRING_PARAMETER_HS_EVENT"