Bineesh  Viswanath

Bineesh Viswanath

  • NA
  • 1k
  • 775.3k

Multiple Foreign Key in a Table

Jun 1 2013 5:58 AM
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)