Link to home
Start Free TrialLog in
Avatar of John86a
John86a

asked on

The DELETE statement conflicted with the REFERENCE constraint....

Ran the command: DELETE FROM [dbo].[USERS]

Got the result:
Msg 547, Level 16, State 0, Line 2
The DELETE statement conflicted with the REFERENCE constraint "FK__Institute__cd_ca__541767F8". The conflict occurred in database "Nova", table "dbo.Institute", column 'cd_userlist'.
The statement has been terminated.


How can I fix this? I need to delete the data inside the table USERS.

ASKER CERTIFIED SOLUTION
Avatar of derekkromm
derekkromm
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lowfatspread
there is referential integrity between the users table and the institute table

such that a user identified on the institute table must exist on the user table....

you need to resolve what you will do with the institute table rows for the users that you intend to delete first....

this type of constraint in "general" implies that it was not considered a "valid business process" to allow users once established to be removed... (there are lots of legal requirements in many jurisdictions which mean it becomes difficult to allow data to be removed , are you certain you are required/allowed to remove your user data?)  you need to check with your business analysts as to what steps should be taken.

Avatar of John86a
John86a

ASKER

Great, thanks!