Troubleshooting Guide: SQL Server Error 5075 – Database Collation Dependency Conflict
Why This Error Happens
This error occurs when you attempt to change a database’s collation while schema-bound objects—such as views, functions, or computed columns created with the SCHEMABINDING option—still reference it. SQL Server 2025 enforces strict dependency checks because schema-bound objects lock in metadata (including collation behavior) at creation time to guarantee deterministic query results. Until every dependency is removed or altered, the engine refuses the ALTER DATABASE ... COLLATE statement to prevent breaking object integrity.
Step-by-Step Resolution Guide
Step 1: Identify the Dependent Objects
- Run the following query to list schema-bound objects tied to the database collation:
SELECT referencing_schema_name, referencing_entity_name, referencing_class_desc
FROM sys.dm_sql_referencing_entities('YourDatabaseName', 'DATABASE');
- Cross-check with
sys.sql_expression_dependenciesfor views and functions usingWITH SCHEMABINDING. - Note down every object name and type (view, function, computed column, check constraint).
Step 2: Remove or Modify Schema-Bound Dependencies
- Script out the definitions of all dependent objects before dropping them (use SSMS “Script Object as DROP and CREATE To”).
- Drop the schema-bound objects using:
DROP VIEW dbo.YourSchemaBoundView;
DROP FUNCTION dbo.YourSchemaBoundFunction;
- For computed columns referencing collation-sensitive expressions, use
ALTER TABLE ... DROP COLUMNtemporarily.
Step 3: Change the Database Collation
- Execute the collation change once all dependencies are cleared:
ALTER DATABASE YourDatabaseName COLLATE SQL_Latin1_General_CP1_CI_AS;
- Ensure no active connections are using the database during this operation (set to
SINGLE_USERmode if needed). - Confirm the change completed without error messages in SSMS or the SQL Server Error Log.
Step 4: Recreate the Dropped Objects
- Re-run the CREATE scripts saved in Step 2 to restore views, functions, and computed columns.
- Verify the objects now inherit the new collation setting correctly.
- Test application queries that depend on these objects to confirm expected behavior.
Alternative or Verification Steps
- Verify the fix by querying
sys.databasesand confirming thecollation_namecolumn reflects the new collation value for your target database. - If recreating objects fails due to lingering references, use
sp_refreshsqlmoduleon each dependent object to force SQL Server to re-validate and align metadata with the new collation.