var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Microsoft SQL Server 2008 Constraints ?
This is my first post in this forums.
Does SQL Server 2008, have any limitations in accepting
explicitly declared multiple foreign keys, example as follows :
CREATE TABLE PracticalSession
StudentNo CHAR(5), /* Belongs To Trainees Table */
EmployeeNo CHAR(4), /* Belongs To DrivingInstructors Table */
RegistrationNo CHAR(6), /* Belongs To Vehicles Table */
PK (PracticalDate, StartTime, StudentNo, EmployeeNo, RegistrationNo),
FK (StudentNo) REFERENCES Trainees (StudentNo)
FK (EmployeeNo) REFERENCES DrivingInstructors (EmployeeNo)
FK (RegistrationNo) REFERENCES Vehicles (RegistrationNo)
Scenario : When a student goes for a driving lesson, the student and instructor are assigned to a vehicle.
Thanks in Advance.
Read here: FOREIGN KEY Constraints
I'm not sure if the 253 limit is a best practise or if SQL Server will throw an exception when creating the 254th fk constraint.
Multiple foreign keys are perfectly OK. The main restriction is that columns in the constraint must exactly match the list of columns in a UNIQUE or PRIMARY KEY constraint or unique index.