'Collate column to SQL default collation

I'm trying to collate a column to the SQL default collation, but can't make it work.

All answers I see are related to database default and not the SQL default

I tried this Alter table x alter column name nvarchar(max) COLLATE DATABASE_DEFAULT but it will give me the database default which is different from the SQL default. (Hebrew vs SQL_LATIN)

I'm also trying to do it with select, but it seems impossible.

This is what I have tried : Alter table x alter column name nvarchar(max) COLLATE (Select SERVERPROPERTY('collation'))



Solution 1:[1]

To check server level collation, use:

 SELECT CONVERT (varchar(256), SERVERPROPERTY('collation'));

To alter column lever collations, use:

ALTER TABLE myTable ALTER COLUMN mycol NVARCHAR(10) COLLATE Greek_CS_AI;  //Replace Greek_CS_AI with the actual value.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 navylover