SQL Server Errors or Failures from Error: 4968 to Error: 4987

SQLServerF1

 

Error: 4968, Severity: 16, ALTR TABLE SWITCH statement failed. Target table ‘%.*ls’ has foreign key for constraint ‘%.*ls’ but source table ‘%.*ls’ does not have corresponding key.
Error: 4969, Severity: 16, ALTR TABLE SWITCH statement failed. Foreign key constraint ‘%.*ls’ is disabled in source table ‘%.*ls’ and the corresponding constraint ‘%.*ls’ is enabled in target table ‘%.*ls’. The source table constraint must be enabled.
Error: 4970, Severity: 16, ALTR TABLE SWITCH statement failed. Target table ‘%.*ls’ has a table level check constraint ‘%.*ls’ but the source table ‘%.*ls’ does not have a corresponding constraint.
Error: 4971, Severity: 16, ALTR TABLE SWITCH statement failed. Target table ‘%.*ls’ has a column level check constraint ‘%.*ls’ but the source table ‘%.*ls’ does not have a corresponding constraint.

Error: 4972, Severity: 16, ALTR TABLE SWITCH statement failed. Check constraints or partition function of source table ‘%.*ls’ allows values that are not allowed by check constraints or partition function on target table ‘%.*ls’.
Error: 4973, Severity: 16, ALTR TABLE SWITCH statement failed. Range defined by partition %d in table ‘%.*ls’ is not a subset of range defined by partition %d in table ‘%.*ls’.
Error: 4974, Severity: 16, ALTR TABLE SWITCH statement failed. Foreign key constraint ‘%.*ls’ is NOCHECK in source table ‘%.*ls’ and the corresponding constraint ‘%.*ls’ is CHECK in target table ‘%.*ls’. The source table constraint must be in CHECK.
Error: 4975, Severity: 16, ALTR TABLE SWITCH statement failed. Check constraint ‘%.*ls’ in source table ‘%.*ls’ and check constraint ‘%.*ls’ in target table ‘%.*ls’ have different ‘Not For Replication’ settings.

Error: 4976, Severity: 16, ALTR TABLE SWITCH statement failed. Target table ‘%.*ls’ has a check constraint ‘%.*ls’ on an XML column, but the source table ‘%.*ls’ does not have an identical check constraint.
Error: 4977, Severity: 16, ALTR TABLE SWITCH statement failed. Target table ‘%.*ls’ has a check constraint ‘%.*ls’ on a CLR type column, but the source table ‘%.*ls’ does not have an identical check constraint.
Error: 4978, Severity: 16, ALTR TABLE SWITCH statement failed. The partition %d in table ‘%.*ls’ resides in a read-only filegroup ‘%.*ls’.
Error: 4979, Severity: 16, ALTR TABLE SWITCH statement failed. The table ‘%.*ls’ resides in a readonly filegroup ‘%.*ls’.
Error: 4980, Severity: 16, ALTR TABLE SWITCH statement failed. The lobdata of partition %d in table ‘%.*ls’ resides in a readonly filegroup ‘%.*ls’.
Error: 4981, Severity: 16, ALTR TABLE SWITCH statement failed. The lobdata of table ‘%.*ls’ resides in a readonly filegroup ‘%.*ls’.
Error: 4982, Severity: 16, ALTR TABLE SWITCH statement failed. Check constraints of source table ‘%.*ls’ allow values that are not allowed by range defined by partition %d on target table ‘%.*ls’.
Error: 4983, Severity: 16, ALTR TABLE SWITCH statement failed. Target table ‘%.*ls’ has an XML or spatial index ‘%.*ls’ on it. Only source table can have XML or spatial indexes in the ALTR TABLE SWITCH statement.
Error: 4984, Severity: 16, ALTR TABLE SWITCH statement failed. Target table ‘%.*ls’ and source table ‘%.*ls’ have different vardecimal storage format values. Use stored procedure sp_tableoption to alter the ‘vardecimal storage format’ option for the tables to make sure that the va
Error: 4985, Severity: 16, ALTR TABLE SWITCH statement failed because column ‘%.*ls’ does not have the same nullability attribute in tables ‘%.*ls’ and ‘%.*ls’.
Error: 4986, Severity: 16, ALTR TABLE SWITCH statement failed because column ‘%.*ls’ does not have the same CLR type in tables ‘%.*ls’ and ‘%.*ls’.
Error: 4987, Severity: 16, ALTR TABLE SWITCH statement failed because column ‘%.*ls’ does not have the same XML Schema Collection in tables ‘%.*ls’ and ‘%.*ls’.

This is applicable on below versions of SQL Server

SQL Server 2005
SQL Server 2008 R2
SQL Server 2012
SQL Server 2014

Hope this was helpful.

Thanks,
SQLServerF1 Team
In-Depth Blogs on SQL Server, Information about SQL Server Conferences and Events, SQL Server Frequently asked questions, SQL Server Trainings.

 

Leave a Reply

Your email address will not be published. Required fields are marked *