How to fix Error 5075 on Windows Server 2025 / Windows 11

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_dependencies for views and functions using WITH 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 COLUMN temporarily.

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_USER mode 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.databases and confirming the collation_name column reflects the new collation value for your target database.
  • If recreating objects fails due to lingering references, use sp_refreshsqlmodule on each dependent object to force SQL Server to re-validate and align metadata with the new collation.