Hi thereI'm new to using SQL Server partitioning. I have 2 schemas within a database, dbo and staging. Each schema contains a set of tables, with PK's, FK's, Unique constraints, Indexes, etc.Both structures are identical within each schema. Each has a partition constraint and function that partitions the data/indexes based on a date (daily partitions).When I try to switch the second to last partition in dbo with that in staging, I get the following error:Msg 4968, Level 16, State 1, Procedure DeleteOldPartition, Line 56ALTER TABLE SWITCH statement failed. Target table 'CRDMPointOfSale.staging.CRDM_AccountPayment' has foreign key for constraint 'FK_AccountPayment_Header' but source table 'CRDMPointOfSale.dbo.CRDM_AccountPayment' does not have corresponding key.
However, staging does have a FK constraint, but to the Header table within the staging schema. Do the tables have to reference the Header table within dbo??? If so, then how do I switch out the Header table?I'm confused ....Hearty head pats