jonwitts

iSAMS Courses to Moodle View v0.3

Oct 5th, 2015
100
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT DISTINCT TblSubjects.txtSubjectName, TblSets.txtSetCode + ' - ' +
  2.                              (SELECT        (RIGHT(CONVERT(VARCHAR(12),
  3.                                                              (SELECT        [txtStartYear]
  4.                                                                FROM            [iSAMS].[dbo].[TblTimetableManagerTimetables]
  5.                                                                WHERE        intPublished = '1')), 2) + '-' + RIGHT(CONVERT(VARCHAR(12), (CONVERT(INT,
  6.                                                              (SELECT        [txtStartYear]
  7.                                                                FROM            [iSAMS].[dbo].[TblTimetableManagerTimetables]
  8.                                                                WHERE        intPublished = '1') + CONVERT(INT, 1)))), 2)) AS txtNCYearRange) AS txtCourseID,
  9.                          TblSubjects.txtSubjectName + ' - ' + TblSets.txtSetCode + ' - ' +
  10.                              (SELECT        (RIGHT(CONVERT(VARCHAR(12),
  11.                                                              (SELECT        [txtStartYear]
  12.                                                                FROM            [iSAMS].[dbo].[TblTimetableManagerTimetables]
  13.                                                                WHERE        intPublished = '1')), 2) + '-' + RIGHT(CONVERT(VARCHAR(12), (CONVERT(INT,
  14.                                                              (SELECT        [txtStartYear]
  15.                                                                FROM            [iSAMS].[dbo].[TblTimetableManagerTimetables]
  16.                                                                WHERE        intPublished = '1') + CONVERT(INT, 1)))), 2)) AS txtNCYearRange) AS txtFullName,
  17.                          TblSubjects.txtSubjectName + ' - ' + TblSets.txtSetCode + ' - ' +
  18.                              (SELECT        (RIGHT(CONVERT(VARCHAR(12),
  19.                                                              (SELECT        [txtStartYear]
  20.                                                                FROM            [iSAMS].[dbo].[TblTimetableManagerTimetables]
  21.                                                                WHERE        intPublished = '1')), 2) + '-' + RIGHT(CONVERT(VARCHAR(12), (CONVERT(INT,
  22.                                                              (SELECT        [txtStartYear]
  23.                                                                FROM            [iSAMS].[dbo].[TblTimetableManagerTimetables]
  24.                                                                WHERE        intPublished = '1') + CONVERT(INT, 1)))), 2)) AS txtNCYearRange) AS txtShortName, '42' AS intCategoryID
  25. FROM            dbo.TblTeachingManagerSets AS TblSets INNER JOIN
  26.                          dbo.TblTeachingManagerSubjects AS TblSubjects ON TblSets.intSubject = TblSubjects.TblTeachingManagerSubjectsID
  27. WHERE        (TblSubjects.txtSubjectName <> 'Private Study') AND (TblSubjects.txtSubjectName <> 'Non Class')
  28. UNION ALL
  29. SELECT DISTINCT
  30.                          TblSubjects.txtSubjectName, LEFT('Stf/' + REPLACE(TblSubjects.txtSubjectName, ' ', ''), 100) AS txtCourseID,
  31.                          TblSubjects.txtSubjectName + ' - Staff Area' AS txtFullName, TblSubjects.txtSubjectName + ' - Staff Area' AS txtShortName,
  32.                          CASE TblSubjects.txtSubjectName WHEN 'Academic Extension' THEN 6 WHEN 'Arabic' THEN 29 WHEN 'Art' THEN 16 WHEN 'Art Graphic' THEN 16 WHEN 'Art Photography'
  33.                           THEN 22 WHEN 'Art Textiles' THEN 17 WHEN 'Biology' THEN 11 WHEN 'Business Studies' THEN 15 WHEN 'Chemistry' THEN 12 WHEN 'Chinese' THEN 30 WHEN 'Classics'
  34.                           THEN 34 WHEN 'Computer Science' THEN 14 WHEN 'Drama' THEN 18 WHEN 'Economics' THEN 15 WHEN 'English' THEN 27 WHEN 'English as an Additional Language'
  35.                           THEN 28 WHEN 'English Language' THEN 27 WHEN 'English Literature' THEN 27 WHEN 'Film Studies' THEN 19 WHEN 'Fine Art' THEN 16 WHEN 'Fitness' THEN 33 WHEN
  36.                           'Food Technology' THEN 21 WHEN 'French' THEN 29 WHEN 'Further Mathematics' THEN 23 WHEN 'Geography' THEN 25 WHEN 'German' THEN 29 WHEN 'Greek' THEN
  37.                           31 WHEN 'Gym' THEN 33 WHEN 'Health Education' THEN 33 WHEN 'History' THEN 26 WHEN 'History of Art' THEN 20 WHEN 'Hockey' THEN 33 WHEN 'Home Economics'
  38.                           THEN 21 WHEN 'Lacrosse' THEN 33 WHEN 'Latin' THEN 31 WHEN 'Learning Support' THEN 37 WHEN 'Mandarin' THEN 30 WHEN 'Mathematics' THEN 23 WHEN 'Music'
  39.                           THEN 32 WHEN 'Music Practice' THEN 32 WHEN 'Netball' THEN 33 WHEN 'Philosophy & Ethics' THEN 36 WHEN 'Physical Education' THEN 33 WHEN 'Physics' THEN
  40.                           13 WHEN 'Politics' THEN 35 WHEN 'Religious Studies' THEN 36 WHEN 'Science' THEN 10 WHEN 'Spanish' THEN 29 WHEN 'Sport' THEN 33 WHEN 'Swimming' THEN
  41.                           33 WHEN 'Textiles Technology' THEN 17 WHEN 'Theatre Studies' THEN 18 ELSE 8 END AS intCategoryID
  42. FROM            dbo.TblTeachingManagerSets AS TblSets INNER JOIN
  43.                          dbo.TblTeachingManagerSubjects AS TblSubjects ON TblSets.intSubject = TblSubjects.TblTeachingManagerSubjectsID
  44. WHERE        (TblSubjects.txtSubjectName <> 'Private Study') AND (TblSubjects.txtSubjectName <> 'Non Class')
  45. UNION ALL
  46. SELECT DISTINCT
  47.                          txtYearName AS txtSubjectName, txtYearName AS txtCourseID, 'iSAMS Sync - ' + txtYearName AS txtFullName, 'iSAMS Sync - ' + txtYearName AS txtShortName,
  48.                          '40' AS intCategoryID
  49. FROM            dbo.TblSchoolManagementYears
  50. UNION ALL
  51. SELECT DISTINCT
  52.                          'iSAMS_Staff' AS txtSubjectName, 'iSAMS_Staff' AS txtCourseID, 'iSAMS Sync - Staff' AS txtFullName, 'iSAMS Sync - Staff' AS txtShortName, '40' AS intCategoryID
  53. UNION ALL
  54. SELECT DISTINCT
  55.         txtHouseName AS txtSubjectName,
  56.         txtHouseName AS txtCourseID,
  57.         'House - ' + txtHouseName AS txtFullName,
  58.         'House - ' + txtHouseName AS txtShortName,
  59.         '38' AS intCategoryID
  60.   FROM dbo.TblSchoolManagementHouses
  61.   WHERE txtHouseType = 'Academic'
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×