Skip to content

Instantly share code, notes, and snippets.

@devcfgc
Last active January 22, 2019 07:13
Show Gist options
  • Save devcfgc/dc6f10e6e6d9ac79b162eb92b550af23 to your computer and use it in GitHub Desktop.
Save devcfgc/dc6f10e6e6d9ac79b162eb92b550af23 to your computer and use it in GitHub Desktop.
Change database collation and unlink any connection to the database to execute the operation
USE master;
GO
ALTER DATABASE DATABASE_NAME
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE DATABASE_NAME
COLLATE Latin1_General_CI_AS ;
GO
--Verify the collation setting.
SELECT name, collation_name
FROM sys.databases
WHERE name = N'DATABASE_NAME';
GO
ALTER DATABASE DATABASE_NAME SET MULTI_USER;
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment