I have 2 Tables: TABQUANHEGD: destination and TABNGUON: source
I implemented sql in SQL Server 2005 with an error
- INSERT INTO TABQUANHEGD(IDQHGD, MASTT, NGUOITHAN, NGAYSINH, MAGT, MAQH, MAQT, OHIENTAI, NGHENGHIEP, NOILAM, DIENTHOAI, TRUGIACANH, NGAYBD, NGAYKT, LIENHE, DAMAT, ANH, GHICHU)
- SELECT IDQHGD, MASTT, NGUOITHAN, NGAYSINH, MAGT, MAQH, MAQT, OHIENTAI, NGHENGHIEP, NOILAM, DIENTHOAI, TRUGIACANH, NGAYBD, NGAYKT, LIENHE, DAMAT, ANH, GHICHU FROM TABNGUON;
Msg 547, Level 16, State 0, Line 1
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_TABKHOKIEMKECT_TABKHOKIEMKE". The conflict occurred in database "NhanSu", table "dbo.TABQUANHEGDTT", column 'IDQH'.
The statement has been terminated.
In the database I don't have these 2 tables:
TABKHOKIEMKECTTABKHOKIEMKE
I don't know where to get these 2 Tables to report an error
I want to copy the content from Table1 to Table2, how do I write an SQL query ?
Dong Lam TrienPosted Sep 7, 2020, 8:05 PM
Nilesh ShahPosted Sep 6, 2020, 8:48 PM
TABQUANHEGDTT.
Dong Lam TrienPosted Sep 6, 2020, 8:22 PM
Nisha RegilPosted Sep 4, 2020, 5:21 AM