Pastes:99006  Views:1870561 

Languages:

   ASP
   C#
   C++
   HTML
   Java
   PHP
   VB.NET
   Visual Basic 6

more languages available...




DirectX 3D Engine

 

 

 

 

 

 

Here's the requested code from the pastebin:

Wrap Lines   Use Line Numbers
CREATE FUNCTION [dbo].[GetSubjectFromClass] 
(  
  -- Add the parameters for the function here
  @classId int
)
RETURNS int 
AS
BEGIN
 
  SELECT TOP 1 SubjectID
  FROM (
    SELECT TOP 1 QuestionID
    FROM
      (
      SELECT TOP 1 ExamVersionID
      FROM  (
          SELECT TOP 1 ExamID
          FROM ClassExams
          WHERE ClassID = @classId
          ) A
      INNER JOIN ExamVersions
      ON ExamVersions.ExamID = A.ExamID
      ) B
    INNER JOIN ExamQuestions
    ON ExamQuestions.ExamVersionID = B.ExamVersionID
    ) C
  INNER JOIN Questions
  ON Questions.QuestionID = C.QuestionID
 
RETURN 
END
 
Syntax Highlighting:  



Copyright 2007 - NoMorePasting.com