And for now, can I use the SP? Itries it but have FK conflicts. must be something in my qury but I can' tfind out what.
I'd appreciate your help if possible.
Here is my query
INSERT INTO UserDefinedData(UserDefinedFieldId, UserDefinedRowId, FieldValue)
VALUES (5, 3, 'name')
INSERT INTO UserDefinedData(UserDefinedFieldId, UserDefinedRowId, FieldValue)
VALUES (6, 3, 'John')
INSERT INTO UserDefinedData(UserDefinedFieldId, UserDefinedRowId, FieldValue)
VALUES (7, 3, '02-5255555')
INSERT INTO UserDefinedData(UserDefinedFieldId, UserDefinedRowId, FieldValue)
VALUES (8, 3, '02-5255555')
INSERT INTO UserDefinedData(UserDefinedFieldId, UserDefinedRowId, FieldValue)
VALUES (9, 3, '02-5255555')
INSERT INTO UserDefinedData(UserDefinedFieldId, UserDefinedRowId, FieldValue)
VALUES (10, 3, '02-5255555')
INSERT INTO UserDefinedData(UserDefinedFieldId, UserDefinedRowId, FieldValue)
VALUES (11, 3, '02-5255555')
INSERT INTO UserDefinedData(UserDefinedFieldId, UserDefinedRowId, FieldValue)
VALUES (12, 3, 'xxx@xxx.com')
And here is the error message:
Server: Msg 547, Level 16, State 1, Line 1
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_UserDefinedData_UserDefinedRows'. The conflict occurred in database 'tomer_db', table 'UserDefinedRows', column 'UserDefinedRowId'.
The statement has been terminated.
Server: Msg 547, Level 16, State 1, Line 1
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_UserDefinedData_UserDefinedRows'. The conflict occurred in database 'tomer_db', table 'UserDefinedRows', column 'UserDefinedRowId'.
The statement has been terminated.
Server: Msg 547, Level 16, State 1, Line 1
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_UserDefinedData_UserDefinedRows'. The conflict occurred in database 'tomer_db', table 'UserDefinedRows', column 'UserDefinedRowId'.
The statement has been terminated.
Server: Msg 547, Level 16, State 1, Line 1
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_UserDefinedData_UserDefinedRows'. The conflict occurred in database 'tomer_db', table 'UserDefinedRows', column 'UserDefinedRowId'.
The statement has been terminated.
Server: Msg 547, Level 16, State 1, Line 1
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_UserDefinedData_UserDefinedRows'. The conflict occurred in database 'tomer_db', table 'UserDefinedRows', column 'UserDefinedRowId'.
The statement has been terminated.
Server: Msg 547, Level 16, State 1, Line 1
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_UserDefinedData_UserDefinedRows'. The conflict occurred in database 'tomer_db', table 'UserDefinedRows', column 'UserDefinedRowId'.
The statement has been terminated.
Server: Msg 547, Level 16, State 1, Line 1
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_UserDefinedData_UserDefinedRows'. The conflict occurred in database 'tomer_db', table 'UserDefinedRows', column 'UserDefinedRowId'.
The statement has been terminated.
Server: Msg 547, Level 16, State 1, Line 1
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_UserDefinedData_UserDefinedRows'. The conflict occurred in database 'tomer_db', table 'UserDefinedRows', column 'UserDefinedRowId'.
The statement has been terminated.