테이블 (제품) 열 - ProductID (FK) 및 ProductType (FK)을 업데이트하려고합니다. 이 두 열은 MProduct 테이블의 MProductID (PK) 열과 MProductType (PK) 열과의 관계가 있습니다.SQL - 업데이트 문의 외래 키 제약 조건 오류
는 표정까지 유효한 모든 기록을 가지고, 나는
ProductID ProductType
9999 11
9999 12
를 업데이트하려고하지만 내가 MProduct 테이블과 점검 다음과 같은 오류
The UPDATE statement conflicted with the FOREIGN KEY constraint "FKHCR_MProduct".
The conflict occurred in database "XXXX", table "dbo.MProduct".
을 얻었다. 테이블 구조를 변경할 수 없습니다.
내가이 쿼리 너무Select ProductID,ProductType
from dbo.Product P
Left Join dbo.MProduct M on M.ProductID = P.ProductID
and M.ProductType = P.ProductType
where M.ProductType is null
and M.ProductID is null
을 시도하고 어떤 출력이, 아니 널 데이터가 조회 테이블 내부가 없음을 의미합니다.
'MproductType이 null이거나 M.ProductID가 null 인 경우 '를 시도하십시오. –
테이블 스키마와 공식 FK 정의를 제공 할 수 있습니까? –
@ 존 - 벌써 조건을 시험해 봅니다 .... – 343