3
Answers

Multiple Foreign Key in a Table

Ask a question
Bineesh  VP

Bineesh VP

11y
945
1
Sir, I am now on SQL Query .

I have a bit error in following Query.

ALTER PROCEDURE  markCreate2
AS
    
     CREATE TABLE tbl_Mark2
     (
     markId int primary key,

     studentId int foreign key references tbl_Student1(studentId),

     subjectId int foreign key references tbl_Subject(subjectId),

     examId int foreign key references tbl_Exam(examId),

     Mark int,

     passMark int,

     maxMark int,
     
     )
 


it saved, but getting a message: - Could not create constraint. See previous errors.
No rows affected.
(0 row(s) returned)
@RETURN_VALUE =
Finished running [dbo].[markCreate2].


please correct this query.

Answers (3)