Upgrade a Replicated Database with CVPA
Anthology Student supports replicating schema changes from the Publisher database to the Subscriber database during upgrades, thus updating a Anthology Student reporting database in place.
We recommend that you perform the following steps to update the reporting (Subscriber) database when upgrading the Anthology Student installation:
-
Create a Transactional Publication (with Snapshot) and a Subscription to it, if not created earlier. Refer to Create a Second Transactional Publication (with Snapshot) and Create a Second Subscription.
-
Run the DenyWritesForAllUsers script below against the Publisher database to prevent any unauthorized changes to the data.
-- MAKE SURE TO RUN THIS ON THE PUBLISHER DATABASE DECLARE @SQLText varchar(1000) IF EXISTS (SELECT 1 FROM sys.tables WHERE Name = 'SyInstallDenyListWork') PRINT 'Error: The SyInstallDenyListWork table already exists!. Contact Campus Management Support.' CREATE TABLE SyInstallDenyListWork (UserName varchar(256)) INSERT dbo.SyInstallDenyListWork SELECT DP.NAME FROM sys.database_principals DP WHERE type != 'R' AND principal_id >= 5 AND NOT EXISTS (SELECT 1 FROM sys.database_principals AS DP1 LEFT JOIN sys.database_role_members AS DRM ON DRM.role_principal_id = DP1.principal_id LEFT JOIN sys.database_principals AS DP2 ON DRM.member_principal_id = DP2.principal_id WHERE DP1.type = 'R' AND DP1.NAME = 'db_denydatawriter' AND DP.NAME = DP2.NAME ) ORDER BY 1 DECLARE UserList CURSOR FOR SELECT 'EXEC sp_addrolemember N''db_denydatawriter'', N''' + UserName + '''' FROM SyInstallDenyListWork OPEN UserList FETCH NEXT FROM UserList INTO @SQLText WHILE @@FETCH_STATUS = 0 BEGIN PRINT @SQLText EXEC(@SQLText) FETCH NEXT FROM UserList INTO @SQLText END CLOSE UserList DEALLOCATE UserList GRANT SELECT on sys.syscomments TO c2000mts GRANT SELECT on sys.sysobjects TO c2000mtsNote: The DenyWritesForAllUsers script adds “db_denydatawriter” database role to all the database users. The “Sysadmin” server role overrides the “db_denydatawriter” database role and thus any user with “sysadmin” previlages will still be able to do data modification.
-
Run the DisableCVueJobs script below against the Publisher database to disable all Anthology Student jobs other than those being carried out by the upgrade. This action prevents any unauthorized changes to data.
-- MAKE SURE TO RUN THIS ON THE PUBLISHER DATABASE DECLARE @JobId UNIQUEIDENTIFIER, @SqlAgentJobName SYSNAME , @JobsCount INT, @Id INT IF EXISTS (SELECT 1 FROM sys.tables WHERE Name = 'SyInstallSQLJobsWork') PRINT 'Error: The SyInstallSQLJobsWork table already exists!. Contact Campus Management Support.' CREATE TABLE SyInstallSQLJobsWork (Id INT IDENTITY(1,1) NOT NULL, JobId UNIQUEIDENTIFIER, JobName SYSNAME, IsJobEnabled BIT) INSERT dbo.SyInstallSQLJobsWork(JobId, JobName, IsJobEnabled) SELECT DISTINCT sj.job_id, sj.name,sj.enabled FROM msdb.dbo.sysjobs sj INNER JOIN msdb.dbo.sysjobsteps sjs ON sj.job_id = sjs.job_id WHERE sjs.database_name = (SELECT DB_NAME()) AND sj.enabled = 1 SELECT @JobsCount = @@ROWCOUNT SET @Id = 1 WHILE @Id <= @JobsCount BEGIN SELECT @JobId = JobId, @SqlAgentJobName = JobName FROM dbo.SyInstallSQLJobsWork WHERE Id = @Id EXEC msdb.dbo.sp_update_job @job_id=@JobId, @enabled = 0 PRINT 'Disabled job ' + @SqlAgentJobName SET @Id = @Id + 1 END GO -
Check for any recommended preinstallation steps prior to the upgrade to the required version.
-
Upgrade the Anthology Student Publisher database all the way up to the required version.
-
Confirm that replication is working by following the steps in the Monitor Replication section and confirming that there are no errors in the Replication Monitor.
-
On the Subscriber database(s), execute the reporting database scripts that are in the installation folder, which is typically at the following location:
<System drive>\Program Files(x86)\CMC\CampusInstall\SetupFiles\Database\CampusVue\Reporting folder
-
Execute the script below on the Publisher database to add newly created tables as Articles to a publication.
-- MAKE SURE TO RUN THIS ON THE PUBLISHER DATABASE SET TRANSACTION ISOLATION LEVEL READ COMMITTED SET NOCOUNT ON CREATE TABLE #Replicate (aid INT IDENTITY(1,1) PRIMARY KEY CLUSTERED, SchemaName VARCHAR(128), TableName VARCHAR(255)) DECLARE @id INT = 0, @SchemaName NVARCHAR(128), @TableName NVARCHAR(255), @tSQL NVARCHAR(2000)= '' DECLARE @Publication NVARCHAR(128) SELECT TOP 1 @Publication = p.NAME FROM dbo.SysArticles a WITH (NOLOCK) INNER JOIN dbo.sysPublications p ON a.Pubid = p.pubid WHERE a.[name] = 'SyReplTableForSnaphotReplicationWork ' BEGIN TRY IF @Publication IS NOT NULL BEGIN INSERT #Replicate (SchemaName, TableName) SELECT schema_name(schema_id) AS SchemaName, NAME AS TableName FROM sys.tables WHERE OBJECTPROPERTY(OBJECT_ID, 'TableHasPrimaryKey') = 1 AND is_ms_shipped = 0 AND ( NAME NOT LIKE '%work' AND NAME NOT LIKE '%isir%work%' AND NAME NOT LIKE '%nsldswork%' AND name NOT LIKE '%isir%_EXT%' AND NAME NOT LIKE '%WorkOrigExt%' AND NAME NOT LIKE '%proxy%' AND NAME NOT LIKE 'syservice%' AND name NOT LIKE '%ExternalMap%' AND NAME NOT LIKE 'syIMS%' AND NAME NOT LIKE 'syQueue%' AND NAME NOT LIKE '%tblPerson%' AND NAME NOT LIKE '%Queue' AND NAME NOT LIKE 'SyPerson_Stag' AND NAME NOT LIKE 'SyPersonUnique_Stag' AND NAME NOT LIKE 'NetSQLAzman%' AND NAME NOT LIKE 'tblStagSyPersonPhoneNumber' AND NAME NOT LIKE 'SyPerson_Stag_Delta' AND NAME NOT LIKE 'Sa1098TBatchToolDetails') AND NAME NOT IN (SELECT DISTINCT NAME FROM dbo.sysarticles) AND NAME NOT IN (SELECT [TableName] FROM ( VALUES ('WebPrivacyPolicyDetail'), ('webCampusScream'), ('webItems'), ('webPages'), ('WebPrivacyPolicy'),('SyScriptRunStats') , ('syInQueue'), ('syMailInboxQueue'), ('syQueueAudit'), ('webStyles'), ('FaB2BclFileSys'),('SyVersionInfo'), ('SyVersion'), ('SyRemovedFromRepl'),('FaShoppingSheetConsumer'),('SyInstallDenyListWork') ) AS vtable([TableName])) SELECT TOP 1 @id = aid, @SchemaName = SchemaName, @TableName = TableName FROM #Replicate WHERE aid > @id ORDER BY aid WHILE (@@ROWCOUNT > 0) BEGIN SET @tSQL = N'EXEC sys.sp_addarticle @publication = ''' + @Publication + N'''' + N' ,@article = ''' + @TableName + N'''' + N' ,@source_owner = ''' + @SchemaName + N'''' + N' ,@source_object = ''' + @TableName + N'''' + N' ,@type = N''logbased''' + N' ,@description = N''''' + N' ,@creation_script = NULL' + N' ,@pre_creation_cmd = N''truncate''' + N' ,@schema_option = 0x00000000080350DF' + N' ,@force_invalidate_snapshot = 1' + N' ,@identityrangemanagementoption = N''manual''' + N' ,@destination_table = ''' + @TableName + N'''' + N' ,@destination_owner = ''' + @SchemaName + N'''' + N' ,@vertical_partition = N''false''' + N' ,@ins_cmd = N''CALL sp_MSins_'+ @SchemaName + @TableName + N'''' + N' ,@del_cmd = N''CALL sp_MSdel_'+ @SchemaName + @TableName + N'''' + N' ,@upd_cmd = N''SCALL sp_MSupd_'+ @SchemaName + @TableName + N'''' PRINT @tSQL EXEC sys.sp_executesql @tSQL SELECT TOP 1 @id = aid, @SchemaName = SchemaName, @TableName = TableName FROM #Replicate WHERE aid > @id ORDER BY aid END EXEC sys.sp_startpublication_snapshot @publication = @publication END ELSE PRINT N'Please create a second publication ' DROP TABLE #Replicate END TRY BEGIN CATCH SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_SEVERITY() AS ErrorSeverity, ERROR_STATE() AS ErrorState, ERROR_LINE() AS ErrorLine, ERROR_MESSAGE() AS ErrorMessage; END CATCH GO SET NOCOUNT OFF GO -
Execute the script below on the Subscriber database to drop the required SQL Constraints and Triggers:
EXEC [dbo].[cmc_DropConstraintsAndTriggersOnSubscriber] GO -
Execute the script below on the Publisher and Subscriber databases to recreate the indexes that were dropped during the upgrade as a result of change in the schema:
DELETE d FROM dbo.SyIndexRecreatePostUpgradeWork d LEFT JOIN dbo.SyIndexRecreatePostUpgradeWork i ON d.SchemaName = i.SchemaName AND d.TableName = i.TableName AND d.ColumnName = i.ColumnName AND d.IndexName = i.IndexName WHERE d.SyIndexRecreatePostUpgradeWorkID < i.SyIndexRecreatePostUpgradeWorkID GO EXEC [dbo].[cmc_IndexRecreatePostUpgradeWork] GO -
Verify the user account used by eThority to run the nightly imports. This is typically an account called “eThorityuser”. Remap if necessary.
-
You can confirm the account used to run the imports by logging in to the eThority application and navigating to Configure è Data Architecture è Data Conduit Maintenance.
-
The SQL account used to run the nightly imports will be displayed next to User ID.
-
Create the database user for that SQL login in the Subscriber database.
-
In SQL Management Studio, expand Security è Logins.
-
Right-click the database user and select Properties.
-
Click the User Mapping link and select the check box next to the Subscriber database to map the login.
-
Select the check box next to the database role db_datareader to give it the necessary access to run the nightly imports.
-
-
-
At the command prompt, using the sqlcmd command, run the cvpasynch.sql script below on the Subscriber database.
Note: With the sqlcmd command, you will need to provide the complete path to the cvpasynch.sql script, and replace the Subscriber and data-warehouse database names appropriately.
Before running the cvpasynch.sql script, make sure to edit the file and change the variables SubscriberDatabaseName and datawarehousedatabasename to match the names of the Subscriber and data-warehouse databases. If you do not do this, the script will not work.
sqlcmd -i C:\temp\cvpasynch.sql -S [subscriber server e.g., qasqlqa5\dev] -E –b
DECLARE @fromdatelstmod DATETIME :setvar SubscriberDatabaseName "SubscriberDB" :setvar datawarehousedatabasename "DatawarehouseDB" USE $(datawarehousedatabasename) PRINT N'Creating Synonym SyScriptRunStatus...'; IF NOT EXISTS (SELECT * FROM sys.synonyms WHERE name = N'SyScriptRunStats') CREATE SYNONYM [dbo].[SyScriptRunStats] FOR $(SubscriberDatabaseName).[dbo].[SyScriptRunStats]; PRINT N'Getting script run begin date time for latest upgrade...'; WITH latestversion ( versionnum ,releasenum ,servicepacknum ,buildnum ,dateapplied ) AS ( SELECT TOP 1 VersionNum ,ReleaseNum ,ServicePackNum ,BuildNum ,DateApplied FROM syversion WHERE 1 = 1 AND DateApplied > GETDATE() - 2 ORDER BY DateApplied DESC ) SELECT @fromdatelstmod = start_ts FROM SyScriptRunStats srs JOIN latestversion lv ON srs.BuildNum = convert(VARCHAR, lv.versionnum) + '.' + convert(VARCHAR, lv.releasenum) + '.' + convert(VARCHAR, lv.servicepacknum) + '.' + convert(VARCHAR, lv.buildnum) PRINT N'Getting records modified after..'+ isnull(convert(varchar,@fromdatelstmod),''); IF (@fromdatelstmod IS NULL) BEGIN PRINT 'From datetime not found..' END IF @fromdatelstmod IS NOT NULL BEGIN PRINT 'inserting records into queue...' INSERT INTO dbo.ETLQueue (DestinationTableName,EntityId,Operation,RecordStatus,[Message],ChangeTime,RecordType,Date_Last_Modified) ( /** Admission Exam **/ SELECT 'Admission_Exam' desttable,AmProspectTestID recordid,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AmProspectTestID, ts from AmProspectTest where datelstmod > @fromdatelstmod) a UNION ALL /** Bank Account **/ SELECT 'Bank_Account',SaBankAccountID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaBankAccountID, ts from SaBankAccount where datelstmod > @fromdatelstmod) a UNION ALL /** Bank Deposit **/ SELECT 'Bank_Deposit',SaBankDepID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaBankDepID, ts from SaBankDep where datelstmod > @fromdatelstmod) a UNION ALL /** Billing Batch **/ SELECT 'Billing_Batch',SaBillingBatchID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaBillingBatchID, ts from SaBillingBatch where datelstmod > @fromdatelstmod) a UNION ALL /** Class Lesson **/ SELECT 'Class_Lesson',AdClassLessonID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdClassLessonID, ts from AdClassLesson where datelstmod > @fromdatelstmod) a UNION ALL /** Class Schedule Day **/ SELECT 'Class_Schedule_Day',AdClassSchedDayID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdClassSchedDayID, ts from AdClassSchedDay where datelstmod > @fromdatelstmod) a UNION ALL /** Class Schedule Term **/ SELECT 'Class_Schedule_Term',AdClassSchedTermID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdClassSchedTermID, ts from AdClassSchedTerm where datelstmod > @fromdatelstmod) a UNION ALL /** Class Schedule **/ SELECT 'Class_Schedule',AdClassSchedID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdClassSchedID, ts from AdClassSched where datelstmod > @fromdatelstmod) a UNION ALL /** Contact Manager Documents **/ SELECT 'Contact_Manager_Documents',cmDocumentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT cmDocumentID, ts from cmDocument where datelstmod > @fromdatelstmod) a UNION ALL /** Employer Contact **/ SELECT 'Employer_Contact',PlEmployerContactID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT PlEmployerContactID, ts from PlEmployerContact where datelstmod > @fromdatelstmod) a UNION ALL /** Employer Job **/ SELECT 'Employer_Job',PlEmployerJobID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT PlEmployerJobID, ts from PlEmployerJob where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment Schedule **/ SELECT 'Enrollment_Schedule',AdEnrollSchedID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdEnrollSchedID, ts from AdEnrollSched where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment Term **/ SELECT 'Enrollment_Term',AdEnrollTermID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdEnrollTermID, ts from AdEnrollTerm where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment **/ SELECT 'Enrollment',AdEnrollID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdEnrollID, ts from AdEnroll where datelstmod > @fromdatelstmod) a UNION ALL /** Contact Manager Activities **/ SELECT 'Contact_Manager_Activities',cmEventID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT cmEventID, ts from cmEvent where datelstmod > @fromdatelstmod) a UNION ALL /** Financial Aid Award Year **/ SELECT 'Financial_Aid_Award_Year',FaStudentAYID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT FaStudentAYID, ts from FaStudentAY where datelstmod > @fromdatelstmod) a UNION ALL /** Financial Aid disbursement schedule **/ SELECT 'Financial_Aid_Disbursement_Schedule',FaDisbID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT FaDisbID, ts from FaDisb where datelstmod > @fromdatelstmod) a UNION ALL /** Financial Aid Loan **/ SELECT 'Financial_Aid_Loan',FaLoanID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT FaLoanID, ts from FaLoan where datelstmod > @fromdatelstmod) a UNION ALL /** Financial Aid Refund **/ SELECT 'Financial_Aid_Refund',FaRefundID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT FaRefundID, ts from FaRefund where datelstmod > @fromdatelstmod) a UNION ALL /** Financial Aid schedule **/ SELECT 'Financial_Aid_Schedule',FaSchedID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT FaSchedID, ts from FaSched where datelstmod > @fromdatelstmod) a UNION ALL /** Financial Aid Packaging **/ SELECT 'Financial_Aid_Packaging',FaStudentAidID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT FaStudentAidID, ts from FaStudentAid where datelstmod > @fromdatelstmod) a UNION ALL /** Lead Expense **/ SELECT 'Lead_Expense',AmLeadExpenseID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AmLeadExpenseID, ts from AmLeadExpense where datelstmod > @fromdatelstmod) a UNION ALL /** Miscellaneous Cash **/ SELECT 'Miscellaneous_Cash',SaMiscCashID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaMiscCashID, ts from SaMiscCash where datelstmod > @fromdatelstmod) a UNION ALL /** Program Course Xref **/ SELECT 'Program_Course_xref',AdProgramCourseID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdProgramCourseID, ts from AdProgramCourse where datelstmod > @fromdatelstmod) a UNION ALL /** Revenue Detail **/ SELECT 'Revenue_Detail',SaRevenueDetailID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaRevenueDetailID, ts from SaRevenueDetail where datelstmod > @fromdatelstmod) a UNION ALL /** Student Account Transactions **/ SELECT 'Student_Account_Transactions',SaTransID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaTransID, ts from SaTrans where datelstmod > @fromdatelstmod) a UNION ALL /** Student Inquiry **/ SELECT 'Student_Inquiry',SyStudentInquiryID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SyStudentInquiryID, ts from SyStudentInquiry where datelstmod > @fromdatelstmod) a UNION ALL /** Student Lead Source **/ SELECT 'Student_Lead_Source',AmProspectLeadSrcID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AmProspectLeadSrcID, ts from AmProspectLeadSrc where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Life_Cycle **/ SELECT 'Student_Life_Cycle',SyStudentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT distinct SyStudentID, CONVERT(binary(8),0) ts from SyStudent where datelstmod > @fromdatelstmod) a UNION ALL /** Student Placement **/ SELECT 'Student_Placement_Detail',PlStudentPlacementID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT PlStudentPlacementID, ts from PlStudentPlacement where datelstmod > @fromdatelstmod) a UNION ALL /** Student Placement Master **/ SELECT 'Student_Placement_Master',PlStudentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT PlStudentID, ts from PlStudent where datelstmod > @fromdatelstmod) a UNION ALL /** Student Placement Reference **/ SELECT 'Student_Placement_Preference_Industry',PlStudentIndustryID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT PlStudentIndustryID, ts from PlStudentIndustry where datelstmod > @fromdatelstmod) a UNION ALL /** Student Placement Preference Job Location **/ SELECT 'Student_Placement_Preference_Job_Location',PlStudentLocationID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT PlStudentLocationID, ts from PlStudentLocation where datelstmod > @fromdatelstmod) a UNION ALL /** Student Placement preference Job Title **/ SELECT 'Student_Placement_Preference_Job_Title',PlStudentJobTitleID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT PlStudentJobTitleID, ts from PlStudentJobTitle where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Placement_Salary **/ SELECT 'Student_Placement_Salary',PlStudentSalaryID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT PlStudentSalaryID, ts from PlStudentSalary where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Placement_Skill **/ SELECT 'Student_Placement_Skill',PlStudentSkillID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT PlStudentSkillID, ts from PlStudentSkill where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Previous_Education **/ SELECT 'Student_Previous_Education',AmProspectPrevEducID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AmProspectPrevEducID, ts from AmProspectPrevEduc where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Program **/ SELECT 'Student_Program',AmProspectProgramID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AmProspectProgramID, ts from AmProspectProgram where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Status_Changes **/ SELECT 'Student_Status_Changes',SyStudentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SyStudentID,CONVERT(binary(8),0) ts from SyStudent where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Subsidiary_Transactions **/ SELECT 'Student_Subsidiary_Transactions',SaStudSubsidiaryTransID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaStudSubsidiaryTransID, ts from SaStudSubsidiaryTrans where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Subsidiary **/ SELECT 'Student_Subsidiary',SaStudSubsidiaryID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaStudSubsidiaryID, ts from SaStudSubsidiary where datelstmod > @fromdatelstmod) a UNION ALL /** Student **/ SELECT 'Student',SyStudentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SyStudentID, ts from SyStudent where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment Certifications **/ SELECT 'Enrollment_Certifications',PlEnrollCertificationsID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT PlEnrollCertificationsID, ts from PlEnrollCertifications where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Agency_Affiliation **/ SELECT 'Student_Agency_Affiliation',SyStudentAgencyID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SyStudentAgencyID, ts from SyStudentAgency where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Groups **/ SELECT 'Student_Groups',SyStudGrpID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SyStudGrpID, ts from SyStudGrp where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Life_Cycle_School_Status **/ SELECT 'Student_Life_Cycle_School_Status',syStudentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT distinct SystudentID,CONVERT(binary(8),0) ts from SyStudent where datelstmod > @fromdatelstmod) a UNION ALL /** Student_School_Defined_Fields */ SELECT 'Student_School_Defined_Fields',SyStudentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT distinct SyStudentID,CONVERT(binary(8),0) ts from SyUserValues where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Address **/ SELECT 'Student_Address',SyAddressID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SyAddressID, ts from SyAddress where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Ethnicity **/ SELECT 'Student_Ethnicity',SyStudentAmraceID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SyStudentAmraceID, ts from SyStudentAmrace where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Service_Association **/ SELECT 'Student_Service_Association',SsStudentServiceAssociationID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SsStudentServiceAssociationID, ts from SsStudentServiceAssociation where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment_Lesson **/ SELECT 'Enrollment_Lesson',AdEnrollLessonID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdEnrollLessonID, ts from AdEnrollLesson where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment_Honors **/ SELECT 'Enrollment_Honors',adEnrollhonorsID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT adEnrollhonorsID, ts from adEnrollhonors where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment_Degree **/ SELECT 'Enrollment_Degree',AdEnrollDegreeID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdEnrollDegreeID, ts from AdEnrollDegree where datelstmod > @fromdatelstmod) a UNION ALL /** Deposits **/ SELECT 'Deposits',AmDepositID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AmDepositID, ts from AmDeposit where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment Fees **/ SELECT 'Enrollment_Fees',AdFeesID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdFeesID, ts from AdFees where datelstmod > @fromdatelstmod) a UNION ALL /** Student Housing Application **/ SELECT 'Student_Housing_Application',HsstudentApplicationID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT HsstudentApplicationID, ts from HsstudentApplication where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Veteran_Detail **/ SELECT 'Student_Veteran_Detail',SsStudentVeteranDetailID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SsStudentVeteranDetailID, ts from SsStudentVeteranDetail where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Veteran_Benefits **/ SELECT 'Student_Veteran_Benefits',SystudentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT systudentId,CONVERT(binary(8),0) ts from SsStudentVeteranDetail where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Disability_Detail **/ SELECT 'Student_Disability_Detail',SsStudentDisabilityDetailID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SsStudentDisabilityDetailID, ts from SsStudentDisabilityDetail where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Athletic_Detail **/ SELECT 'Student_Athletic_Detail',SsAthleticDetailID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SsAthleticDetailID, ts from SsAthleticDetail where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Housing_Application_Answer **/ SELECT 'Student_Housing_Application_Answer',HsStudentApplicationAnswersID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT HsStudentApplicationAnswersID, ts from HsStudentApplicationAnswers where datelstmod > @fromdatelstmod) a UNION ALL /**Student_Housing_Information */ SELECT 'Student_Housing_Information',AdEnrollID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdEnrollID, ts from SsStudHousingInfo where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Lease_History */ SELECT 'Student_Lease_History',HSStudentLeaseHistoryID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT HSStudentLeaseHistoryID, ts from HSStudentLeaseHistory where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment_Areas_Of_Study */ SELECT 'Enrollment_Areas_Of_Study',AdConcentrationByEnrollmentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdConcentrationByEnrollmentID, ts from AdConcentrationByEnrollment where datelstmod > @fromdatelstmod) a UNION ALL /** Student_GPA **/ SELECT 'Student_GPA',AdGPAStudentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdGPAStudentID, ts from AdGPAStudent where datelstmod > @fromdatelstmod) a UNION ALL /** Student_GPA_Course **/ SELECT 'Student_GPA_Course',AdGPAStudentCourseID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdGPAStudentCourseID, ts from AdGPAStudentCourse where datelstmod > @fromdatelstmod) a UNION ALL /** Student_International **/ SELECT 'Student_International',SyStudentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SyStudentID, ts from SyStudentNI where datelstmod > @fromdatelstmod) a UNION ALL /** Student_International_Dependent **/ SELECT 'Student_International_Dependent',SyStudentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SyStudentID,CONVERT(binary(8),0) ts from SyStudentNIDependent where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment_Advisor **/ SELECT 'Enrollment_Advisor',AdEnrollID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdEnrollID,CONVERT(binary(8),0) ts from SyAdvisorByEnroll where datelstmod > @fromdatelstmod) a UNION ALL /** Transfer_Credit **/ SELECT 'Transfer_Credit',AmCollegeTransferID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AmCollegeTransferID, ts from AmCollegeTransfer where datelstmod > @fromdatelstmod) a UNION ALL /** Enrollment_Term_Confirmation **/ SELECT 'Enrollment_Term_Confirmation',AdEnrollID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdEnrollID, ts from AdEnrollTermConfirm where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Stipend_Schedule **/ SELECT 'Student_Stipend_Schedule',SaStipendSchedID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaStipendSchedID, ts from SaStipendSched where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Stipend **/ SELECT 'Student_Stipend',SaStipendID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaStipendID, ts from SaStipend where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Account_Collection **/ SELECT 'Student_Account_Collection',SaCollectionsID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaCollectionsID, ts from SaCollections where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Collection_Account_Status **/ SELECT 'Student_Collection_Account_Status',SaCollectionAccountStatusID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaCollectionAccountStatusID, ts from SaCollectionAccountStatus where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Group_Tuition_Discount_Policy **/ SELECT 'Student_Group_Tuition_Discount_Policy',SaTuitionDiscountPolicyStudentGroupID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaTuitionDiscountPolicyStudentGroupID, ts from SaTuitionDiscountPolicyStudentGroup where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Tuition_Discount_Policy_Course_Attribute **/ SELECT 'Student_Tuition_Discount_Policy_Course_Attribute',SaTuitionDiscountPolicyCourseAttributeID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaTuitionDiscountPolicyCourseAttributeID, ts from SaTuitionDiscountPolicyCourseAttribute where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Tuition_Discount_Policy_Course_Level **/ SELECT 'Student_Tuition_Discount_Policy_Course_Level',SaTuitionDiscountPolicyCourseLevelID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT SaTuitionDiscountPolicyCourseLevelID, ts from SaTuitionDiscountPolicyCourseLevel where datelstmod > @fromdatelstmod) a UNION ALL /** Class_Attendance **/ SELECT 'Class_Attendance',adclassattendID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT adclassattendID, ts from adclassattend where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Attendance **/ SELECT 'Student_Attendance',AdAttendID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdAttendID, ts from AdAttend where datelstmod > @fromdatelstmod) a UNION ALL /** Student_Extra_Curricular **/ SELECT 'Student_Extra_Curricular',AmProspectExtraCurrID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AmProspectExtraCurrID, ts from AmProspectExtraCurr where datelstmod > @fromdatelstmod) a UNION ALL /** Class_Schedule_Book **/ SELECT 'Class_Schedule_Book',AdClassSchedBookListID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdClassSchedBookListID, ts from AdClassSchedBookList where datelstmod > @fromdatelstmod) a UNION ALL /** Class_Schedule_PreReq_Document **/ SELECT 'Class_Schedule_PreReq_Document',AdClassSchedPreReqDocumentID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT AdClassSchedPreReqDocumentID, ts from AdClassSchedPreReqDocument where datelstmod > @fromdatelstmod) a UNION ALL /** Loan_Management_Status_Change **/ SELECT 'Loan_Management_Status_Change',lmstatchangeID,'UPDATE','QUEUED', null,GETDATE(),'CURRENT', GETDATE() FROM ( SELECT lmstatchangeID, ts from lmstatchange where datelstmod > @fromdatelstmod) a ) PRINT 'Scripts Executed' END GO USE $(subscriberdatabasename) if not exists (select 1 from sys.databases where name=DB_NAME() and is_cdc_enabled = 1) EXEC sys.sp_cdc_enable_db if not exists (select 1 from sys.tables where name = 'AdDegree' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdDegree' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'Adenroll' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adenroll' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdProgram' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdProgram' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdProgramGroup' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdProgramGroup' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adprogramversion' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adprogramversion' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adsapstatus' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adsapstatus' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdShift' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdShift' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adstartdate' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adstartdate' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmAgency' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmAgency' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'ambudgetedstart' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'ambudgetedstart' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmCitizen' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmCitizen' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmCollege' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmCollege' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmExtraCurr' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmExtraCurr' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'amleadcat' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'amleadcat' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmLeadExpense' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmLeadExpense' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'amleadsrc' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'amleadsrc' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmLeadType' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmLeadType' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmMarital' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmMarital' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmNationality' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmNationality' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmPrevEduc' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmPrevEduc' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'amprospectadmissrep' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'amprospectadmissrep' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'amprospectleadsrc' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'amprospectleadsrc' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmRace' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmRace' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'amreptype' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'amreptype' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmSex' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmSex' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmTitle' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmTitle' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'cmevent' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'cmevent' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'cmeventresult' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'cmeventresult' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'cmeventstatus' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'cmeventstatus' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'cmeventtype' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'cmeventtype' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'cmtemplate' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'cmtemplate' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'FaFundSource' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'FaFundSource' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'fapackstatus' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'fapackstatus' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'FaSched' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'FaSched' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'FaStudentAid' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'FaStudentAid' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'fastudentay' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'fastudentay' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'plemployer' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'plemployer' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'plstudent' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'plstudent' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'plstudentplacement' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'plstudentplacement' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaTrans' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaTrans' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'syAdvisorByEnroll' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'syAdvisorByEnroll' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'syCampus' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'syCampus' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SyCampusGrp' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SyCampusGrp' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'sycampuslist' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'sycampuslist' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SyCountry' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SyCountry' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SyCounty' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SyCounty' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'syschoolstatus' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'syschoolstatus' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'systaff' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'systaff' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'systaffbygroup' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'systaffbygroup' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'systaffgroup' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'systaffgroup' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'systatchange' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'systatchange' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'systatus' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'systatus' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'systatuscategory' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'systatuscategory' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'systudent' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'systudent' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'systudentinquiry' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'systudentinquiry' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'syStudentAmrace' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'systudentamrace' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'amprospectpreveduc' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'amprospectpreveduc' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'plstatchange' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'plstatchange' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaEnrollRevenue' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaEnrollRevenue' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'amprospecttest' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'amprospecttest' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adclassschedterm' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adclassschedterm' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adclasssched' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adclasssched' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adclasslesson' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adclasslesson' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adclassschedday' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adclassschedday' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adenrollterm' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adenrollterm' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'plstudentindustry' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'plstudentindustry' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'PlStudentLocation' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'PlStudentLocation' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'PlStudentJobTitle' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'PlStudentJobTitle' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'PlStudentSalary' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'PlStudentSalary' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'PlStudentSkill' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'PlStudentSkill' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdEnrollSched' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdEnrollSched' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'FaLoan' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'FaLoan' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'FaDisb' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'FaDisb' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'FaRefund' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'FaRefund' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmProspectProgram' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmProspectProgram' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'PlEmployerContact' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'PlEmployerContact' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'PlEmployerJob' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'PlEmployerJob' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdProgramCourse' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdProgramCourse' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaBillingBatch' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaBillingBatch' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaBankDep' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaBankDep' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaBankAccount' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaBankAccount' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaStudSubsidiary' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaStudSubsidiary' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaStudSubsidiaryTrans' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaStudSubsidiaryTrans' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaRevenueDetail' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaRevenueDetail' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaMiscCash' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaMiscCash' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmCollegeTransfer' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmCollegeTransfer' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'cmDocument' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'cmDocument' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'cmDocumentTranscript' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'cmDocumentTranscript' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'syUserValues' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'syUserValues' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'PlEnrollCertifications' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'PlEnrollCertifications' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SyStudentAgency' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SyStudentAgency' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SyStudGrp' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SyStudGrp' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SyAddress' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SyAddress' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SsStudentServiceAssociation' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SsStudentServiceAssociation' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdEnrollLesson' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdEnrollLesson' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adEnrollhonors' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adEnrollhonors' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdEnrollDegree' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdEnrollDegree' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmDeposit' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmDeposit' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adfees' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adfees' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'HsStudentApplication' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'HsStudentApplication' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SsStudentVeteranDetail' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SsStudentVeteranDetail' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SsStudentDisabilityDetail' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SsStudentDisabilityDetail' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SsAthleticDetail' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SsAthleticDetail' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'HsStudentApplicationAnswers' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'HsStudentApplicationAnswers' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SsStudHousingInfo' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SsStudHousingInfo' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'HSStudentLeaseHistory' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'HSStudentLeaseHistory' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdConcentrationByEnrollment' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdConcentrationByEnrollment' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdGPAStudent' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdGPAStudent' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdGPAStudentCourse' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdGPAStudentCourse' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SyStudentNI' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SyStudentNI' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SyStudentNIDependent' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SyStudentNIDependent' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdEnrollTermConfirm' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdEnrollTermConfirm' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'lmstatchange' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'lmstatchange' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaStipendSched' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaStipendSched' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaStipend' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaStipend' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaCollections' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaCollections' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaCollectionAccountStatus' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaCollectionAccountStatus' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaTuitionDiscountPolicyStudentGroup' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaTuitionDiscountPolicyStudentGroup' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaTuitionDiscountPolicyCourseAttribute' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaTuitionDiscountPolicyCourseAttribute' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'SaTuitionDiscountPolicyCourseLevel' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'SaTuitionDiscountPolicyCourseLevel' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'adclassattend' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'adclassattend' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdAttend' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdAttend' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmProspectExtraCurr' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmProspectExtraCurr' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdClassSchedBookList' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdClassSchedBookList' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AdClassSchedPreReqDocument' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AdClassSchedPreReqDocument' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'AmProspectExtraCurr' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'AmProspectExtraCurr' , @role_name = null , @supports_net_changes = 0 if not exists (select 1 from sys.tables where name = 'FaStudentPell' and is_tracked_by_cdc = 1) EXEC sys.sp_cdc_enable_table @source_schema = N'dbo' , @source_name = N'FaStudentPell' , @role_name = null , @supports_net_changes = 0 EXECUTE sys.sp_cdc_change_job @job_type = N'cleanup',@retention = 10080 Print 'Change Data Capture Enabled. Retention Period set to 10080' go -
Run the ReverseDenyWritesForAllUsers script below against the Publisher database.
DECLARE @SQLText varchar(1000) BEGIN TRY DECLARE UserList CURSOR FOR SELECT 'EXEC sp_droprolemember N''db_denydatawriter'', N''' + UserName + '''' FROM SyInstallDenyListWork OPEN UserList FETCH NEXT FROM UserList INTO @SQLText WHILE @@FETCH_STATUS = 0 BEGIN PRINT @SQLText EXEC(@SQLText) FETCH NEXT FROM UserList INTO @SQLText END CLOSE UserList DEALLOCATE UserList IF EXISTS (SELECT 1 FROM sys.tables WHERE Name = 'SyInstallDenyListWork') DROP TABLE SyInstallDenyListWork END TRY BEGIN CATCH PRINT 'Denial of privileges may not have been fully revoked. The following error occurred: ' + CAST(ERROR_NUMBER() as varchar(20)) + ' - ' + ERROR_MESSAGE() END CATCH -
Run the EnableCvueJobs script below against the Publisher database.
-- MAKE SURE TO RUN THIS ON THE PUBLISHER DATABASE DECLARE @JobId UNIQUEIDENTIFIER, @SqlAgentJobName SYSNAME, @JobsCount INT, @Id INT IF NOT EXISTS (SELECT 1 FROM sys.tables WHERE Name = 'SyInstallSQLJobsWork') PRINT 'Error: The SyInstallSQLJobsWork table already exists!. Contact Campus Management Support.' SELECT @JobsCount = Count(1) FROM dbo.SyInstallSQLJobsWork SET @Id = 1 WHILE @Id <= @JobsCount BEGIN SELECT @JobId = JobId, @SqlAgentJobName = JobName FROM dbo.SyInstallSQLJobsWork WHERE Id = @Id IF EXISTS (SELECT 1 FROM msdb.dbo.sysjobs sj WHERE job_id = @JobId) BEGIN EXEC msdb.dbo.sp_update_job @job_id=@JobId, @enabled = 1 PRINT 'Enabled job ' + @SqlAgentJobName END SET @Id = @Id + 1 END DROP TABLE SyInstallSQLJobsWork GO