I have a database table called Lesson
:
columns: [LessonID, LessonNumber, Description]
...plus some other columns
I hav
Given the SQL Server constraint on this, why don't you solve this problem by creating a table with SelectionID (PK), LessonID, Next_LessonID, QualifyingScore as the columns. Use a constraint to ensure LessonID and QualifyingScore are unique.
In the QualifyingScore column, I'd use a tinyint, and make it 0, 1, or 2. That, or you could do a QualifyingMinScore and QualifyingMaxScore column so you could say,
SELECT * FROM NextLesson
WHERE LessonID = @MyLesson
AND QualifyingMinScore <= @MyScore
AND @MyScore <= QualifyingMaxScore
Cheers,
Eric
You can't have more than one cascading RI link to a single table in any given linked table. Microsoft explains this:
You receive this error message because in SQL Server, a table cannot appear more than one time in a list of all the cascading referential actions that are started by either a DELETE or an UPDATE statement. For example, the tree of cascading referential actions must only have one path to a particular table on the cascading referential actions tree.