

delete from [AssessmentSettingDetail]
delete from [AssessmentSetting]
delete from [Sequence]
delete from [FinanceYearMaster]
delete from [YearlySettings]
delete from [FeeMaster]
delete from [AccountLedger]
delete from [AccountGroup]
---------delete select * from [UserAccess]
--------select * from PermissionPolicyUser
--------select * from PermissionPolicyRole
--------select * from PermissionPolicyUserUsers_PermissionPolicyRoleRoles
--------select * from PermissionPolicyObjectPermissionsObject
--------select * from AcademyXSchool_JMHSS.dbo.SecuritySystemObjectPermissionsObject
delete from [Settings]
delete from [ConstantInfo]
delete from [ERPMaster]
delete from [AcademicYearMaster]
update UserAccess set School = null
delete from [School]
delete from [Organization]
delete from [Party]
delete from [Address]	
delete from [Country]	
delete from DataLocation
delete from AttendanceRegisterDet
delete from AttendanceRegisterMast

INSERT INTO [Country] ([Oid],[Name],[PhoneCode],[OptimisticLockField],[GCRecord])
select * from AcademyXSchool_JMHSS.dbo.Country

INSERT INTO Address ([Oid],[Street],[City],[StateProvince],[ZipPostal],[Country],[OptimisticLockField],[GCRecord])
select * from AcademyXSchool_JMHSS.dbo.Address

INSERT INTO Party ([Oid],[Photo],[Address1],[Address2],[OptimisticLockField],[GCRecord],[ObjectType])
select * from AcademyXSchool_JMHSS.dbo.Party

INSERT INTO Organization ([Oid],[FullName],[Profile],[Email],[WebSite],[Description],[Name] )
select [Oid],[FullName],[Profile],[Email],[WebSite],[Description],[Name] From AcademyXSchool_JMHSS.dbo.Organization

INSERT INTO [ConstantInfo] ([Oid],[constantName],[Description],[ShortDesc],[LanguageDescription],[Display],[IndexValue],[Term],[Assessment],[Pattern],[OptimisticLockField],[GCRecord])
select [Oid],[constantName],[Description],[ShortDesc],[LanguageDescription],[Display],[IndexValue],[Term],[Assessment],[Pattern],[OptimisticLockField],[GCRecord] from AcademyXSchool_JMHSS.dbo.[ConstantInfo]

insert into School ([Oid],[WorkingDays],[PID],[SID],[CID],[Board],[SubTitle],[RegNo],[EducationalDistrict],[RevenueDistrict],[ISOLogo],[FromTime],[ToTime],[Principal],[Correspondence],[Chairman],[HRUpdate],[Zone]
,[TamilSchoolName],[TamilEducationalDistrict],[TamilRevenueDistrict],[TamilZone])            
select [Oid],[WorkingDays],[PID],[SID],[CID],[Board],[SubTitle],[RegNo],[EducationalDistrict],[RevenueDistrict],[ISOLogo],[FromTime],[ToTime],[Principal],[Correspondence],[Chairman],[HRUpdate],[Zone]
,[TamilSchoolName],[TamilEducationalDistrict],[TamilRevenueDistrict],[TamilZone]
From AcademyXSchool_JMHSS.dbo.School
             
             --select *  From School
             --update UserAccess set School = '08ACDB07-FBA6-4B07-AD14-C63F991E6ED0'
             
INSERT INTO [ERPMaster] ([Oid],[MasterName],[Description],[LanguageDescription],[Display],[ShortName],[IndexValue],[HRUpdate],[editable],[RoomType],[DepartmentType],[Community]
,[Department],[WrittenExam],[SubjectCategory],[Pattern] ,[ConversionMark],[MaxMark],[MinMark],[StudentActivity],[ActivityType],[OptimisticLockField],[GCRecord])
select [Oid],[MasterName],[Description],[LanguageDescription],[Display],[ShortName],[IndexValue],[HRUpdate],[editable],[RoomType],[DepartmentType],[Community]
,[Department],[WrittenExam],[SubjectCategory],[Pattern] ,[ConversionMark],[MaxMark],[MinMark],[StudentActivity],[ActivityType],[OptimisticLockField],[GCRecord] 
From AcademyXSchool_JMHSS.dbo.[ERPMaster] 

INSERT INTO [AcademicYearMaster] ([Oid],[StartYear],[EndYear],[StartDate],[EndDate],[AcademicYear],[CurrentAcademicYear],[Status],[WebStatus],[HRUpdate],[OptimisticLockField],[GCRecord])
select [Oid],[StartYear],[EndYear],[StartDate],[EndDate],[AcademicYear],[CurrentAcademicYear],[Status],[WebStatus],[HRUpdate],[OptimisticLockField],[GCRecord] From AcademyXSchool_JMHSS.dbo.[AcademicYearMaster] 

INSERT INTO [Settings]([Oid],[DomainName],[SMTP],[EMailID],[PassWord],[PortNo],[Provider],[SMSUrl],[SMSSendForamt],[SMSUserName],[SMSPassword],[SMSSenderName],[SMSChennel],[SMSFlash],[SMSRoute],[SMSToken],[SMSMobileNo],[SMSSendEmailID],[TestSMSMessage]
,[FeeReceiptSMS],[FeeReceiptSMSMsg],[LibraryBookDueSMSMsg],[OptionalSubjectFeeStructure],[TransportHostelFee],[OverAllFeeDetail],[OverAllFeeDate],[AlertMessageOn],[ShowDetail],[ShowAblum],[TransportFee]
,[HostelAndMessFee],[libraryWithMemberShip],[DeptWiseStock],[MaterialRequisition],[ShowExamModule],[VerifyQuantity],[Attend],[Fifo],[SkipShortageItems],[PromotionStatusCurrentYear]
,[ClassPromotionToSection],[Accounts],[TallyExport],[IIT],[Hostel],[Transport],[Library],[AppliFee],[ApplicationFee],[RegFee],[RegistrationFee],[MiscellaneousFee],[FeeReceipt],[PurchaseInwardPosting]
,[FuelPurchasePosting],[DebitNotePosting],[ConcessionsFee],[AutoPhotoLoading],[StudentImageFile],[StaffImageFile],[PhotoGallery],[ImageType],[SRToken],[JessiDownloadURL]
,[FontName],[Bold],[FontSize],[TamilFontName],[TamilBold],[TamilFontSize],[MailCopyFolder],[CCEmail],[ImageAlign],[UpdateLocation],[SchoolId],[OptimisticLockField],[GCRecord])
select [Oid],[DomainName],[SMTP],[EMailID],[PassWord],[PortNo],[Provider],[SMSUrl],[SMSSendForamt],[SMSUserName],[SMSPassword],[SMSSenderName],[SMSChennel],[SMSFlash],[SMSRoute],[SMSToken],[SMSMobileNo],[SMSSendEmailID],[TestSMSMessage]
,[FeeReceiptSMS],[FeeReceiptSMSMsg],[LibraryBookDueSMSMsg],[OptionalSubjectFeeStructure],[TransportHostelFee],[OverAllFeeDetail],[OverAllFeeDate],[AlertMessageOn],[ShowDetail],[ShowAblum],[TransportFee]
,[HostelAndMessFee],[libraryWithMemberShip],[DeptWiseStock],[MaterialRequisition],[ShowExamModule],[VerifyQuantity],[Attend],[Fifo],[SkipShortageItems],[PromotionStatusCurrentYear]
,[ClassPromotionToSection],[Accounts],[TallyExport],[IIT],[Hostel],[Transport],[Library],[AppliFee],[ApplicationFee],[RegFee],[RegistrationFee],[MiscellaneousFee],[FeeReceipt],[PurchaseInwardPosting]
,[FuelPurchasePosting],[DebitNotePosting],[ConcessionsFee],[AutoPhotoLoading],[StudentImageFile],[StaffImageFile],[PhotoGallery],[ImageType],[SRToken],[JessiDownloadURL]
,[FontName],[Bold],[FontSize],[TamilFontName],[TamilBold],[TamilFontSize],[MailCopyFolder],[CCEmail],[ImageAlign],[UpdateLocation],[SchoolId],[OptimisticLockField],[GCRecord] 
From AcademyXSchool_JMHSS.dbo.[Settings] 
  
----INSERT INTO [PermissionPolicyRole] ([Oid],[Name],[PermissionPolicy],[OptimisticLockField],[CanEditModel] ,[GCRecord])
----select [Oid],[Name],0,[ObjectType],[OptimisticLockField],[CanEditModel] ,[GCRecord] from AcademyXSchool_JMHSS.dbo.[SecuritySystemRole]

--INSERT INTO [UserAccess] ([Oid],[StaffName],[ResetUserDeptRight],[School],[StaffEMAil],[StaffSMS],[StudentEmail],[StudentSMS],[SubjectSkillPerformance],[DailyFeeCollection],[ShowFeeDueList],[ShowTodayFeeCollection]
--,[ShowTodayFeePending],[ShowPhotoGallery],[BackupRestore],[EditReceiptPayable],[DateEdit],[BookReader],[ExamProgressGenerate] ,[StaffPerformanceReport],[Rescoring],[AlertPOOn],[AlertStudentBirthdayOn],[AlertStaffBirthdayOn]
--,[AlertHoildayOn],[AlertStudentsDueOn],[PhotoBulkUpload],[ColumnChooserHide],[ImportExportHide],[InventroyItem],[MessItem],[LibraryBook],[OtherItem],[PermententRemove],[EditPromotionResult],[Report],[Settings],[Accounts]
--,[Receipt],[DisplayStoreItems],[HRUpdate],[SMTP],[EMailID],[PassWord],[PortNo])
--select [Oid],[StaffName],[ResetUserDeptRight],[School],[StaffEMAil],[StaffSMS],[StudentEmail],[StudentSMS],[SubjectSkillPerformance],[DailyFeeCollection],[ShowFeeDueList],[ShowTodayFeeCollection]
--,[ShowTodayFeePending],[ShowPhotoGallery],[BackupRestore],[EditReceiptPayable],[DateEdit],[BookReader],[ExamProgressGenerate] ,[StaffPerformanceReport],[Rescoring],[AlertPOOn],[AlertStudentBirthdayOn],[AlertStaffBirthdayOn]
--,[AlertHoildayOn],[AlertStudentsDueOn],[PhotoBulkUpload],[ColumnChooserHide],[ImportExportHide],[InventroyItem],[MessItem],[LibraryBook],[OtherItem],[PermententRemove],[EditPromotionResult],[Report],[Settings],[Accounts]
--,[Receipt],[DisplayStoreItems],[HRUpdate],[SMTP],[EMailID],[PassWord],[PortNo]
--From AcademyXSchool_JMHSS.dbo.[UserAccess] 

INSERT INTO [AccountGroup] ([Oid],[GroupName] ,[UnderGroup],[NatureOfGroup],[HeadId],[Description],[ParentGroup],[OptimisticLockField],[GCRecord])
select [Oid],[GroupName] ,[UnderGroup],[NatureOfGroup],[HeadId],[Description],[ParentGroup],[OptimisticLockField],[GCRecord]
From AcademyXSchool_JMHSS.dbo.[AccountGroup] 

INSERT INTO [AccountLedger] ([Oid],[LedgerName],[GroupName],[OpeningBalance],[AccountType],[ForTheDate],[Photo],[ClosingBalanceDr],[ClosingBalanceCr],[ClosingBalance],[LedgerBalanceDr],[LedgerBalanceCr]
,[LedgerBalance],[DoorNo],[Street],[City],[State],[Pincode],[PhoneNumber],[MobileNumber],[EMailId],[TinNo],[GSTNo],[CSTNo],[PanNo],[SchoolId],[OptimisticLockField],[GCRecord])
select [Oid],[LedgerName],[GroupName],[OpeningBalance],[AccountType],[ForTheDate],[Photo],[ClosingBalanceDr],[ClosingBalanceCr],[ClosingBalance],[LedgerBalanceDr],[LedgerBalanceCr]
,[LedgerBalance],[DoorNo],[Street],[City],[State],[Pincode],[PhoneNumber],[MobileNumber],[EMailId],[TinNo],[GSTNo],[CSTNo],[PanNo],[SchoolId],[OptimisticLockField],[GCRecord]
From AcademyXSchool_JMHSS.dbo.[AccountLedger] 


INSERT INTO [FeeMaster] ([Oid],[FeeName],[DisplayFeeName],[Applicablefor],[StudentWiseFee],[GenderGroup],[FeeUnder],[Ledger],[priority],[CollectOn]
,[EnableCostCenter],[CostCategory],[CostCenterName],[AccountLedger],[FixedAmount],[FixedAmountX],[Hide],[SchoolId],[OptimisticLockField],[GCRecord])
select [Oid],[FeeName],[DisplayFeeName],[Applicablefor],[StudentWiseFee],[GenderGroup],[FeeUnder],[Ledger],[priority],[CollectOn]
,[EnableCostCenter],[CostCategory],[CostCenterName],[AccountLedger],[FixedAmount],[FixedAmountX],[Hide],[SchoolId],[OptimisticLockField],[GCRecord]
From AcademyXSchool_JMHSS.dbo.[FeeMaster] 


INSERT INTO [YearlySettings] ([Oid],[EffectiveOn],[TransportFee],[TransportDeposit],[NoteBookFee],[TextBookFee],[UniformFee],[StationaryFee],[HostelFee],[MessBillFee]
,[GeneralFeearrear],[TransportFeeArrear],[BookFeeArrear],[HostelCautionFee],[RegistrationFee],[ApplicationFee],[RefundLedger],[RefundAccountLedger],[StudentPromotion]
,[CCEPattern],[GroupReceiptType],[ChallanType],[HiddenFee],[GroupReceiptPrintingType],[HiddenFeePrintingType],[AcademicYearId],[SchoolId],[OptimisticLockField],[GCRecord])
select [Oid],[EffectiveOn],[TransportFee],[TransportDeposit],[NoteBookFee],[TextBookFee],[UniformFee],[StationaryFee],[HostelFee],[MessBillFee]
,[GeneralFeearrear],[TransportFeeArrear],[BookFeeArrear],[HostelCautionFee],[RegistrationFee],[ApplicationFee],[RefundLedger],[RefundAccountLedger],[StudentPromotion]
,[CCEPattern],[GroupReceiptType],[ChallanType],[HiddenFee],[GroupReceiptPrintingType],[HiddenFeePrintingType],[AcademicYearId],[SchoolId],[OptimisticLockField],[GCRecord]
From AcademyXSchool_JMHSS.dbo.[YearlySettings] 


INSERT INTO [FinanceYearMaster] ([Oid],[StartYear],[EndYear],[StartDate],[EndDate],[FinanceYear],[CurrentFinanceYear],[OptimisticLockField],[GCRecord])
select [Oid],[StartYear],[EndYear],[StartDate],[EndDate],[FinanceYear],[CurrentFinanceYear],[OptimisticLockField],[GCRecord] From AcademyXSchool_JMHSS.dbo.[FinanceYearMaster] 

INSERT INTO [Sequence] ([Oid],[TypeName],[ModelName],[School],[AcademicYear],[FinanceYear],[NextSequence],[PreFixCode],[ChallanSequence],[ChallanPreFix],[Note],[SchoolId],[OptimisticLockField],[GCRecord])
select [Oid],[TypeName],[ModelName],[School],[AcademicYear],[FinanceYear],[NextSequence],[PreFixCode],[ChallanSequence],[ChallanPreFix],[Note],[SchoolId],[OptimisticLockField],[GCRecord] 
From AcademyXSchool_JMHSS.dbo.[Sequence] 


INSERT INTO [SubjectMaster] ([Oid],[SubjectCode],[SubjectCategory],[SubjectName],[LanguageDescription],[Hierarchy],[ShortName],[OptionalGroup]
,[Priority],[ColourCode],[Description],[schoolNamelanguagein],[LanguageFontName],[LanguageBold],[LanguageFontSize],[OptimisticLockField],[GCRecord])
select [Oid],[SubjectCode],[SubjectCategory],[SubjectName],[LanguageDescription],[Hierarchy],[ShortName],[OptionalGroup]
,[Priority],[ColourCode],[Description],[schoolNamelanguagein],[LanguageFontName],[LanguageBold],[LanguageFontSize],[OptimisticLockField],[GCRecord]
From AcademyXSchool_JMHSS.dbo.[SubjectMaster] 

INSERT INTO [SubjectGroup]([Oid],[SubjectGroupName],[OptimisticLockField],[GCRecord])
select [Oid],[SubjectGroupName],[OptimisticLockField],[GCRecord] From AcademyXSchool_JMHSS.dbo.[SubjectGroup]

INSERT INTO [SubjectGroupDetail] ([Oid],[SubjectGroupName],[SubjectName],[SubjectCategory],[Optional],[OptimisticLockField],[GCRecord])
select [Oid],[SubjectGroupName],[SubjectName],[SubjectCategory],[Optional],[OptimisticLockField],[GCRecord] From AcademyXSchool_JMHSS.dbo.[SubjectGroupDetail]


INSERT INTO [ClassMaster] ([Oid],[ClassName],[Category],[RoomCategory],[StaffCategories],[Hierarchy],[IsSectionGroupAvailable],[SubjectGroupName]
,[MinimumAge],[PerDayNoOfPeriod],[AllowToCourseCompletion],[ClassNameInWords],[TCIssued],[SchoolId],[OptimisticLockField],[GCRecord])
select [Oid],[ClassName],[Category],[RoomCategory],[StaffCategories],[Hierarchy],[IsSectionGroupAvailable],[SubjectGroupName]
,[MinimumAge],[PerDayNoOfPeriod],[AllowToCourseCompletion],[ClassNameInWords],[TCIssued],[SchoolId],[OptimisticLockField],[GCRecord]
From AcademyXSchool_JMHSS.dbo.[ClassMaster]     

INSERT INTO [SectionMaster] ([Oid],[ClassID],[SectionName],[MaxStudent],[Medium],[SectionGroup],[SubjectGroupName],[ResetOrLoadSubjectName],[OrderNo],[DeActive],[OptimisticLockField],[GCRecord])
select [Oid],[ClassID],[SectionName],[MaxStudent],[Medium],[SectionGroup],[SubjectGroupName],[ResetOrLoadSubjectName],[OrderNo],[DeActive],[OptimisticLockField],[GCRecord] From AcademyXSchool_JMHSS.dbo.[SectionMaster]     

INSERT INTO [SectionSubject] ([Oid],[SlNo],[SectionName],[SubjectName],[Optional],[DefaultOptionalSubject],[SubjectCategory]
,[AcademicYearId],[SubjectClosing],[WeeklyNoOfPeriod],[ClosingYear],[OptimisticLockField],[GCRecord])
select [Oid],[SlNo],[SectionName],[SubjectName],[Optional],[DefaultOptionalSubject],[SubjectCategory]
,[AcademicYearId],[SubjectClosing],[WeeklyNoOfPeriod],[ClosingYear],[OptimisticLockField],[GCRecord]
From AcademyXSchool_JMHSS.dbo.[SectionSubject]     

INSERT INTO [FeeStructure] ([Oid],[ClassName],[SectionGroup],[OptionalSubject],[FeeType],[FeeIndex],[FeeName],[Amount],[AcademicYearId],[SchoolId],[OptimisticLockField],[GCRecord])
select [Oid],[ClassName],[SectionGroup],[OptionalSubject],[FeeType],[FeeIndex],[FeeName],[Amount],[AcademicYearId],[SchoolId],[OptimisticLockField],[GCRecord] From AcademyXSchool_JMHSS.dbo.[FeeStructure] 

INSERT INTO [DataLocation] ([Oid],[InputLocation],[Location],[SystemName],[IP],[LastAccessTime],[LicenseKey],[BarcodeReaderRate],[BarcodeReaderPort],[TimeTableActive],[HRActive],[Deactive],[LocalMessage],[OptimisticLockField],[GCRecord])
select [Oid],[InputLocation],[Location],[SystemName],[IP],[LastAccessTime],[LicenseKey],[BarcodeReaderRate],[BarcodeReaderPort],[TimeTableActive],[HRActive],[Deactive],[LocalMessage],[OptimisticLockField],[GCRecord] From AcademyXSchool_JMHSS.dbo.[DataLocation]     

INSERT INTO [BaseAddress] ([Oid],[Street],[Area],[Taluk],[City],[District],[State],[Country],[ZipPostal],[OptimisticLockField],[GCRecord])
select [Oid],[Street],[Area],[Taluk],[City],[District],[State],[Country],[ZipPostal],[OptimisticLockField],[GCRecord] From AcademyXSchool_JMHSS.dbo.BaseAddress   

INSERT INTO [StudentApplication] ([Oid],[Photo],[ApplicationNo],[ApplicationDate],[Title],[FirstName],[LastName],[MiddleName],[ApplicantName],[TamilApplicantName],[PaymentMode],[PaymentRef],[Birthday],[Email]
,[MobileNo],[Gender],[ClassApplied],[PreferredGroup],[MotherTongue],[Nationality],[Religion],[Community],[Caste],[PhysicallyChallenged],[FatherName],[TamilFatherName],[FatherAddress] ,[FatherQualification]
,[FatherOccupation],[FatherMobileNo],[FatherEmail],[FatherIncome],[MotherName],[TamilMotherName],[MotherAddress],[MotherQualification],[MotherOccupation],[MotherMobileNo],[MotherEmail],[MotherIncome]
,[GuardianName],[GuardianAddress],[GuardianRelation],[GuardianMobileNo],[GuardianEmail],[GuardianIncome],[AnnualIncome],[PreviousSchool],[PreviousClass],[PreviousBoard],[ApplicationStatus],[AcademicYearId]
,[SchoolId],[DataInput],[CommunicationAddress],[PermanentAddress],[OptimisticLockField],[GCRecord]
--,[UserInput]
)    
Select [Oid],[Photo],[ApplicationNo],[ApplicationDate],[Title],[FirstName],[LastName],[MiddleName],[ApplicantName],[TamilApplicantName],[PaymentMode],[PaymentRef],[Birthday],[Email]
,[MobileNo],[Gender],[ClassApplied],[PreferredGroup],[MotherTongue],[Nationality],[Religion],[Community],[Caste],[PhysicallyChallenged],[FatherName],[TamilFatherName],[FatherAddress] ,[FatherQualification]
,[FatherOccupation],[FatherMobileNo],[FatherEmail],[FatherIncome],[MotherName],[TamilMotherName],[MotherAddress],[MotherQualification],[MotherOccupation],[MotherMobileNo],[MotherEmail],[MotherIncome]
,[GuardianName],[GuardianAddress],[GuardianRelation],[GuardianMobileNo],[GuardianEmail],[GuardianIncome],[AnnualIncome],[PreviousSchool],[PreviousClass],[PreviousBoard],[ApplicationStatus],[AcademicYearId]
,[SchoolId],[DataInput],[CommunicationAddress],[PermanentAddress],[OptimisticLockField],[GCRecord]
--,[UserInput]
From AcademyXSchool_JMHSS.dbo.[StudentApplication]     

INSERT INTO [StudentMaster]([Oid],[SequentialNumber],[Photo],[AdmissionNo],[AdmnDate],[ApplicationNo],[TransferCertificate],[BirthCertificate],[RulesAndRegulations]
,[ClassJoined],[SectionJoined],[SectionGroup],[OptionalSubject],[BloodGroup],[IndentificationMark1],[IndentificationMark2],[PhysicalDisability],[DoctorName],[DoctorAddress],[DoctorPhoneNo]
,[AadharNo],[TCNo],[WhoisWorking],[EMIS],[AcademicYearJoined],[ImageFileName],[SchoolId],[PersistentColor],[Status],[CurrentAcademicYear],[DataInput],[OptimisticLockField],[GCRecord]
--,[UserInput]
)
select [Oid],[SequentialNumber],[Photo],[AdmissionNo],[AdmnDate],[ApplicationNo],[TransferCertificate],[BirthCertificate],[RulesAndRegulations]
,[ClassJoined],[SectionJoined],[SectionGroup],[OptionalSubject],[BloodGroup],[IndentificationMark1],[IndentificationMark2],[PhysicalDisability],[DoctorName],[DoctorAddress],[DoctorPhoneNo]
,[AadharNo],[TCNo],[WhoisWorking],[EMIS],[AcademicYearJoined],[ImageFileName],[SchoolId],[PersistentColor],[Status],[CurrentAcademicYear],[DataInput],[OptimisticLockField],[GCRecord]
--,[UserInput]
From AcademyXSchool_JMHSS.dbo.[StudentMaster]      
 

INSERT INTO [StudentSection] ([Oid],[StudentName],[AcademicYearId],[ClassName],[SectionName],[SectionGroup],[OptionalSubjectName],[OptionalGroupName]
,[OptionalSubject1],[OptionalGroup1],[ChangeFrom],[Status],[StudentOrder],[RollNo],[BoardExamNo],[HouseGroup],[IIT],[RTE],[Library],[Hostel],[Transport]
,[Concession],[BusStopName],[ModeOfTransport],[TransportEntryNo],[ConcessionName],[StaffName],[CourseCompleted],[TCIssued],[Activities],[ExtraActivities]
,[PersistentColor],[MyGoals],[Strengths],[MyInterestsAndHobbies],[Achievements],[Height],[Weight],[Remarks],[VisionLeft],[VisionRight],[DentalHygiene]
,[SchoolId],[NextYearTransfer],[OptimisticLockField],[GCRecord]
)
select [Oid],[StudentName],[AcademicYearId],[ClassName],[SectionName],[SectionGroup],[OptionalSubjectName],[OptionalGroupName]
,[OptionalSubject1],[OptionalGroup1],[ChangeFrom],[Status],[StudentOrder],[RollNo],[BoardExamNo],[HouseGroup],[IIT],[RTE],[Library],[Hostel],[Transport]
,[Concession],[BusStopName],[ModeOfTransport],[TransportEntryNo],[ConcessionName],[StaffName],[CourseCompleted],[TCIssued],[Activities],[ExtraActivities]
,[PersistentColor],[MyGoals],[Strengths],[MyInterestsAndHobbies],[Achievements],[Height],[Weight],[Remarks],[VisionLeft],[VisionRight],[DentalHygiene]
,[SchoolId],[NextYearTransfer],[OptimisticLockField],[GCRecord] From AcademyXSchool_JMHSS.dbo.[StudentSection]      


INSERT INTO [StudentDiscontinue] ([Oid],[SequentialNumber],[TCCode],[TCDate],[StudentName],[BalanceFeeAmount],[LastAttendDate],[Reason],[Remarks],[TCIssued],[StudentFailed],[qualified],[qualifiedDesc],[TotalWorkDays]
,[TotalPresentDays] ,[StudentConduct],[Subject],[TCIssuedDate],[Status],[AcademicYearId],[Document],[Cancel],[CancelDate],[CancelReason],[SchoolId],[DataInput],[ReceiptPerson],[OptimisticLockField],[GCRecord]
--,[UserInput]
)
select [Oid],[SequentialNumber],[TCCode],[TCDate],[StudentName],[BalanceFeeAmount],[LastAttendDate],[Reason],[Remarks],[TCIssued],[StudentFailed],[qualified],[qualifiedDesc],[TotalWorkDays]
,[TotalPresentDays] ,[StudentConduct],[Subject],[TCIssuedDate],[Status],[AcademicYearId],[Document],[Cancel],[CancelDate],[CancelReason],[SchoolId],[DataInput],[ReceiptPerson],[OptimisticLockField],[GCRecord]
--,[UserInput]
From AcademyXSchool_JMHSS.dbo.[StudentDiscontinue]      

select * from school
update useraccess set school = '08ACDB07-FBA6-4B07-AD14-C63F991E6ED0'
select * from useraccess
select * from PermissionPolicyUser
update [StudentApplication] set UserInput = 'A89B5980-633F-4119-A2CD-09EFDBBC5E65'
update [StudentMaster] set UserInput = 'A89B5980-633F-4119-A2CD-09EFDBBC5E65'
update [StudentDiscontinue] set UserInput = 'A89B5980-633F-4119-A2CD-09EFDBBC5E65'


INSERT INTO [AttendanceRegisterMast] ([Oid],[SequentialNumber],[AMonth],[Month],[Year],[YearMonth],[TotalWorkingDays],[ClassName],[SectionName],[AcademicYearId],[SchoolId] ,[DataInput],[OptimisticLockField],[GCRecord])
Select [Oid],[SequentialNumber],[AMonth],[Month],[Year],[YearMonth],[TotalWorkingDays],[ClassName],[SectionName],[AcademicYearId],[SchoolId] ,[DataInput],[OptimisticLockField],[GCRecord] From AcademyXSchool_JMHSS.dbo.[AttendanceRegisterMast]

INSERT INTO [AttendanceRegisterDet]([Oid],[MasterID],[StudentName],[Term],[MPresent]
,[D1],[D2],[D3],[D4],[D5],[D6],[D7],[D8],[D9],[D10],[D11],[D12],[D13],[D14],[D15],[D16]
,[D17],[D18],[D19],[D20],[D21],[D22],[D23],[D24],[D25],[D26],[D27],[D28],[D29],[D30],[D31],[OptimisticLockField],[GCRecord])
select [Oid],[MasterID],[StudentName],[Term],[MPresent]
,[D1],[D2],[D3],[D4],[D5],[D6],[D7],[D8],[D9],[D10],[D11],[D12],[D13],[D14],[D15],[D16]
,[D17],[D18],[D19],[D20],[D21],[D22],[D23],[D24],[D25],[D26],[D27],[D28],[D29],[D30],[D31],[OptimisticLockField],[GCRecord]
From AcademyXSchool_JMHSS.dbo.[AttendanceRegisterDet]      

