Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use VirtualTransferAdvisor
- -- Change this user name (or pattern) to the one you want to delete
- declare @userName varchar(50) = 'host'
- declare @studentId int
- select @studentId = StudentId
- from
- Students
- where
- UserName = @userName
- update FinancialSets
- set
- YearlyStudentProfileId = null
- from
- FinancialSets fs
- where
- fs.StudentId = @studentId
- delete YearlyStudentProfiles
- from
- YearlyStudentProfiles ysp
- join FinancialSets fs on
- ysp.FinancialSetId = fs.FinancialSetId
- where
- fs.StudentId = @studentId
- delete FinancialFactors
- from
- FinancialFactors ff
- join FinancialSets fs on
- ff.FinancialSetId = fs.FinancialSetId
- where
- fs.StudentId = @studentId
- delete InformationalFinancialFactors
- from
- InformationalFinancialFactors iff
- join FinancialSets fs on
- iff.FinancialSetId = fs.FinancialSetId
- where
- fs.StudentId = @studentId
- delete StudentLoanPayoffs
- where
- StudentId = @studentId
- delete StudentMonthlyBudgets
- where
- StudentId = @studentId
- delete FinancialSets
- where
- StudentId = @studentId
- delete StudentDisclaimerSignOffs
- where
- StudentId = @studentId
- update Students
- set
- StudentProfileId = null
- where
- UserName like @userName
- delete StudentProfiles
- where
- StudentId = @studentId
- delete AcademicProfiles
- where
- StudentId = @studentId
- delete Students where UserName like @userName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement