當我嘗試excecute這個代碼,我得到錯誤的DELETE語句:衝突與限制參考
用限制性參考「FK_Options_users」 DELETE語句的衝突。衝突發生在數據庫「WINTOUR」,表「PrintForm.Options」,'user_code'列
無法理解爲什麼以及如何解決這個問題。
declare
@USER_CODE int;
select
@USER_CODE = 24;
delete from Settings.Items where user_code = @USER_CODE
delete from usnet where code = @USER_CODE
delete from usgroups where usercode = @USER_CODE
delete from users where code = @USER_CODE