Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ------------------------------------------
- -- Create the SQL Scripts
- ------------------------------------------
- USE SDS_KelsoSchoolDistrict_Staging_Wespac
- GO
- SELECT 'TRUNCATE TABLE ' + sysobjects.name
- FROM sysobjects
- WHERE sysobjects.name LIKE 'IdMap%'
- SELECT 'TRUNCATE TABLE ' + REPLACE(sysobjects.name, 'IdMap', '')
- FROM sysobjects
- WHERE sysobjects.name LIKE 'IdMap%'
- ORDER BY sysobjects.name
- */
- --USE SDS_KelsoSchoolDistrict_Staging_Wespac
- --USE SDS_SheltonSchoolDistrict_Staging_Wespac
- --USE SDS_IssaquahSchoolDistrict_Staging_Wespac
- --USE SDS_BainbridgeIslandSchoolDistrict_Staging_Wespac
- --USE SDS_YakimaSchoolDistrict_Staging_Wespac
- USE SDS_NorthThurstonSchoolDistrict_Staging_Wespac
- GO
- TRUNCATE TABLE IdMapGuardians
- TRUNCATE TABLE IdMapApplicationUserRoles
- TRUNCATE TABLE IdMapStudentGradePointAverages
- TRUNCATE TABLE IdMapGradePointAverageTypes
- TRUNCATE TABLE IdMapStudentFoodserviceSubsidies
- TRUNCATE TABLE IdMapAbsenceTypes
- TRUNCATE TABLE IdMapStudentHandicappingConditions
- TRUNCATE TABLE IdMapHandicappingConditions
- TRUNCATE TABLE IdMapPhoneNumbers
- TRUNCATE TABLE IdMapPersons_PhoneNumbers
- TRUNCATE TABLE IdMapPersonSchoolDepartmentAssignments
- TRUNCATE TABLE IdMapDisciplineActions
- TRUNCATE TABLE IdMapPrincipalSchoolYears
- TRUNCATE TABLE IdMapPrincipals
- TRUNCATE TABLE IdMapClassTermDateRanges
- TRUNCATE TABLE IdMapLanguages
- TRUNCATE TABLE IdMapEntities_Addresses
- TRUNCATE TABLE IdMapEntities
- TRUNCATE TABLE IdMapAddresses
- TRUNCATE TABLE IdMapTeacherSchoolYears
- TRUNCATE TABLE IdMapStudentSchoolYears
- TRUNCATE TABLE IdMapClassTermTypes
- TRUNCATE TABLE IdMapPhoneNumberTypes
- TRUNCATE TABLE IdMapFakePersons
- TRUNCATE TABLE IdMapStudentDisciplineRecords
- TRUNCATE TABLE IdMapDisciplineOffenses
- TRUNCATE TABLE IdMapClassTeachingAssignments
- TRUNCATE TABLE IdMapClasses
- TRUNCATE TABLE IdMapPersons_Languages
- TRUNCATE TABLE IdMapPersons_Ethnicities
- TRUNCATE TABLE IdMapStudentClassEnrollments
- TRUNCATE TABLE IdMapAutomatedLoginApplications
- TRUNCATE TABLE IdMapStudentClassAttendanceRecords
- TRUNCATE TABLE IdMapEntities_EmailAddresses
- TRUNCATE TABLE IdMapEntities_PhoneNumbers
- TRUNCATE TABLE IdMapPersons_Addresses
- TRUNCATE TABLE IdMapStudentClassTermGrades
- TRUNCATE TABLE IdMapClassAttendanceRecords
- TRUNCATE TABLE IdMapEmployees
- TRUNCATE TABLE IdMapGradeLevels
- TRUNCATE TABLE IdMapActivities_SupervisoryPersons
- TRUNCATE TABLE IdMapEmailAddressTypes
- TRUNCATE TABLE IdMapSchoolDistricts
- TRUNCATE TABLE IdMapAddressTypes
- TRUNCATE TABLE IdMapStudents_HealthConditions
- TRUNCATE TABLE IdMapSchoolYears
- TRUNCATE TABLE IdMapSchoolTypes
- TRUNCATE TABLE IdMapClassTerms
- TRUNCATE TABLE IdMapClassTermSegments
- TRUNCATE TABLE IdMapSchools
- TRUNCATE TABLE IdMapActivities
- TRUNCATE TABLE IdMapSkywardPersons
- TRUNCATE TABLE IdMapPersons
- TRUNCATE TABLE IdMapAbsenceReasons
- TRUNCATE TABLE IdMapTeachers
- TRUNCATE TABLE IdMapSchoolDepartments
- TRUNCATE TABLE IdMapStudents_Activities
- TRUNCATE TABLE IdMapStudents
- TRUNCATE TABLE IdMapEthnicities
- TRUNCATE TABLE IdMapGuardianTypes
- TRUNCATE TABLE IdMapPersons_EmailAddresses
- TRUNCATE TABLE IdMapEmailAddresses
- TRUNCATE TABLE IdMapFoodServiceSubsidies
- TRUNCATE TABLE IdMapStudentIllnessRecords
- TRUNCATE TABLE IdMapHealthConditions
- TRUNCATE TABLE IdMapStudentGuardianRelationships
- --USE SDS_KelsoSchoolDistrict
- --USE SDS_SheltonSchoolDistrict
- --USE SDS_IssaquahSchoolDistrict
- --USE SDS_BainbridgeIslandSchoolDistrict
- --USE SDS_YakimaSchoolDistrict
- USE SDS_NorthThurstonSchoolDistrict
- GO
- -- Student Attendance, Absence, and reasons
- TRUNCATE TABLE StudentClassAttendanceRecords
- DELETE AbsenceReasons
- DBCC CHECKIDENT ('AbsenceReasons', RESEED, 0)
- DELETE AbsenceTypes
- DBCC CHECKIDENT ('AbsenceTypes', RESEED, 0)
- -- Student Activities
- TRUNCATE TABLE Activities_SupervisoryPersons
- TRUNCATE TABLE Students_Activities
- DELETE Activities
- DBCC CHECKIDENT ('Activities', RESEED, 0)
- -- Student Health, handicapps, and Illness
- TRUNCATE TABLE Students_HealthConditions
- TRUNCATE TABLE StudentIllnessRecords
- DELETE HealthConditions
- DBCC CHECKIDENT ('HealthConditions', RESEED, 0)
- TRUNCATE TABLE StudentHandicappingConditions
- DELETE HandicappingConditions
- DBCC CHECKIDENT ('HandicappingConditions', RESEED, 0)
- -- Classes, Enrollments Assignment
- TRUNCATE TABLE StudentClassTermGrades
- DELETE StudentClassEnrollments
- DBCC CHECKIDENT ('StudentClassEnrollments', RESEED, 0)
- DELETE ClassAttendanceRecords
- TRUNCATE TABLE ClassTeachingAssignments
- DBCC CHECKIDENT ('ClassTeachingAssignments', RESEED, 0)
- DELETE Classes
- DBCC CHECKIDENT ('Classes', RESEED, 0)
- -- Class Terms, Types, and Segments
- TRUNCATE TABLE ClassTermDateRanges
- DELETE ClassTermSegments --DBCC CHECKIDENT ('ClassTermSegments', RESEED, 0)
- DELETE ClassTerms --DBCC CHECKIDENT ('ClassTerms', RESEED, 0)
- DELETE ClassTermTypes --DBCC CHECKIDENT ('ClassTermTypes', RESEED, 0)
- TRUNCATE TABLE StudentFoodserviceSubsidies
- DELETE FoodServiceSubsidies
- DBCC CHECKIDENT ('FoodServiceSubsidies', RESEED, 0)
- -- Student Discipline
- TRUNCATE TABLE StudentDisciplineRecords
- DELETE DisciplineActions
- DBCC CHECKIDENT ('DisciplineActions', RESEED, 0)
- DELETE DisciplineOffenses
- -- Student Grade-Point averages
- TRUNCATE TABLE StudentGradePointAverages
- DELETE GradePointAverageTypes
- DBCC CHECKIDENT ('GradePointAverageTypes', RESEED, 0)
- -- School District Departments
- TRUNCATE TABLE PersonSchoolDepartmentAssignments
- DELETE SchoolDepartments
- DBCC CHECKIDENT ('SchoolDepartments', RESEED, 0)
- DELETE SchoolDistricts --DBCC CHECKIDENT ('SchoolDistricts', RESEED, 0)
- -- Role/School year augmented association records
- DELETE PrincipalSchoolYears
- DELETE StudentSchoolYears
- DELETE TeacherSchoolYears
- -- Schools, Types, and School Years
- DELETE Schools
- DBCC CHECKIDENT ('Schools', RESEED, 0)
- DELETE SchoolTypes --DBCC CHECKIDENT ('SchoolTypes', RESEED, 0)
- DELETE SchoolYears --DBCC CHECKIDENT ('SchoolYears', RESEED, 0)
- -- Roles
- TRUNCATE TABLE StudentGuardianRelationships
- TRUNCATE TABLE SkywardPersons
- TRUNCATE TABLE Employees
- DELETE Principals --DBCC CHECKIDENT ('Principals', RESEED, 0)
- DELETE Teachers --DBCC CHECKIDENT ('Teachers', RESEED, 0)
- DELETE Students --DBCC CHECKIDENT ('Students', RESEED, 0)
- DELETE Guardians --DBCC CHECKIDENT ('Guardians', RESEED, 0)
- DELETE GuardianTypes
- DBCC CHECKIDENT ('GuardianTypes', RESEED, 0)
- -- Contact info association records
- TRUNCATE TABLE Persons_Addresses
- TRUNCATE TABLE Entities_Addresses
- TRUNCATE TABLE Entities_EmailAddresses
- TRUNCATE TABLE Entities_PhoneNumbers
- TRUNCATE TABLE Entities_Addresses
- TRUNCATE TABLE Persons_EmailAddresses
- TRUNCATE TABLE Persons_Ethnicities
- TRUNCATE TABLE Persons_Languages
- TRUNCATE TABLE Persons_PhoneNumbers
- -- Languages, Ethnicities and Subsidies
- DELETE Languages
- DBCC CHECKIDENT ('Languages', RESEED, 0)
- DELETE Ethnicities
- DBCC CHECKIDENT ('Ethnicities', RESEED, 0)
- -- Automated Logins and Application Users
- TRUNCATE TABLE AutomatedLoginAccounts
- DELETE AutomatedLoginApplications --DBCC CHECKIDENT ('AutomatedLoginApplications', RESEED, 0)
- TRUNCATE TABLE ApplicationUsers_Roles
- DELETE ApplicationUsers
- DBCC CHECKIDENT ('ApplicationUsers', RESEED, 0)
- -- Contact info records
- DELETE EmailAddresses
- DBCC CHECKIDENT ('EmailAddresses', RESEED, 0)
- DELETE PhoneNumbers
- DBCC CHECKIDENT ('PhoneNumbers', RESEED, 0)
- DELETE Addresses
- DBCC CHECKIDENT ('Addresses', RESEED, 0)
- DELETE Persons
- DBCC CHECKIDENT ('Persons', RESEED, 0)
- DELETE Entities
- DBCC CHECKIDENT ('Entities', RESEED, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement