{"id":1132,"date":"2021-08-23T08:00:00","date_gmt":"2021-08-23T05:00:00","guid":{"rendered":"https:\/\/www.dataplatform.gr\/?p=1132"},"modified":"2023-08-27T16:17:19","modified_gmt":"2023-08-27T13:17:19","slug":"ti-einai-to-collation-kai-pos-allazei-ston-sql-server","status":"publish","type":"post","link":"https:\/\/www.dataplatform.gr\/en\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/","title":{"rendered":"What is collation and how it changes in SQL Server"},"content":{"rendered":"<p>With one sentence <strong>collation <\/strong>is the way characters are encoded in a database. That is, you define whether it will be<strong> case sensitive<\/strong>&nbsp; (uppercase, lowercase), what language the varchar and text fields are in. <\/p>\n\n\n\n<p>Fields like nvarchar which are in Unicode format are not affected by the encoding of the characters, but it affects the sort since depending on the collation there may be a different order of letters or be affected by the case sensitive.<\/p>\n\n\n\n<p>The collation on <strong>system databases<\/strong> and on&nbsp; <strong>user databases<\/strong> could be different from each other since SQL Server 2000 and later.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">How can we see what collation all databases have with query<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">select name,databasepropertyex(name,'COLLATION'),databasepropertyex(name,'Recovery'),databasepropertyex(name,'STATUS') from master.dbo.sysdatabases<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"717\" height=\"220\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1-col.png\" alt=\"\" class=\"wp-image-1135\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1-col.png 717w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/1-col-300x92.png 300w\" sizes=\"auto, (max-width: 717px) 100vw, 717px\" \/><\/figure>\n\n\n\n<p>The collation at <strong>master database <\/strong>defines the collation in the rest of the system bases as well. This may affect system functions such as database login and sort on <strong>tempdb<\/strong>.<\/p>\n\n\n\n<p>The collation on&nbsp; <strong>user databases<\/strong> affects as we mentioned first of all what language the <strong>non-unicode<\/strong> characters and there is a basic problem when we decide to change it. That whatever data was passed up to the moment of the change will remain with the collation they had.<\/p>\n\n\n\n<p>Even if we have the wrong collation in one base, we can read the field with a different collation, e.g. on a base that is in&nbsp; <strong>SQL_Latin1_General_CP1253_CI_AI<\/strong>&nbsp; with the following query we can read the Greek characters:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">select cast (Onoma as varchar(100)) collate Greek_CI_AS\nfrom Pelatis<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">To change the collation in the database<\/h2>\n\n\n\n<p>To change the collation to&nbsp;<strong>user databases<\/strong>&nbsp;the following steps should be taken so that we do not have the problem we mentioned above and that not all records in the database have the same collation (it is good to have done them <strong>backup <\/strong>before we start):<\/p>\n\n\n\n<p>1 \u2013 We export the generate script of the base (its structure):<\/p>\n\n\n\n<p><em>Right click on the database, Tasks, Generate scripts\u2026 , Script entire database and all database objects<\/em><\/p>\n\n\n\n<p>2 \u2013 With the following script that I have made, generate the statements so that we can do <strong>bcp out<\/strong>&nbsp;and <strong>bcp in<\/strong> the whole base. We execute it and keep both columns.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">declare \n@user varchar(50),\n@pass varchar(50),\n@pathout varchar(200),\n@pathin varchar(200)\n\nset @user = 'username'\nset @pass = 'password'\nset @pathout = 'c:\\backups\\'\nset @pathin = 'c:\\backups\\'\n\nSELECT \n'bcp '           --bcp\n+  QUOTENAME(DB_NAME())+ '.'               \n+  QUOTENAME(SCHEMA_NAME(SCHEMA_ID))+ '.'  -- \n+  QUOTENAME(name)                         \n+ ' out ' +@pathout                        \n+  REPLACE(SCHEMA_NAME(schema_id),' ','') + '_' \n+  REPLACE(name,' ','')                    \n+ '.txt -S'\n+ REPLACE(REPLACE(QUOTENAME(@@servername),'[',''),']','')  --server name\n+' -U'+@user+' -P'+@pass+' '  --username  pass\n+'-n -t[cdel] -r[rdel]'  ,  \nAS  BCP_OUT,\n\n'bcp '           --bcp\n+  QUOTENAME(DB_NAME())+ '.'               \n+  QUOTENAME(SCHEMA_NAME(SCHEMA_ID))+ '.' \n+  QUOTENAME(name)                         \n+ ' in '+@pathin                          \n+  REPLACE(SCHEMA_NAME(schema_id),' ','') + '_' \n+  REPLACE(name,' ','')                   \n+ '.txt -S'\n+ REPLACE(REPLACE(QUOTENAME(@@servername),'[',''),']','')  --server name\n+' -U'+@user+' -P'+@pass+' '  --username  pass\n+'-w -n'\n+' -e'+@pathin +'logbcpin.txt'\n+' -t[cdel] -r[rdel]'   ,  \nAS  BCP_IN\nfrom sys.tables<\/pre>\n\n\n\n<p>3 \u2013 We execute it<strong> bcp out<\/strong> in command prompt from step 2.<\/p>\n\n\n\n<p>4 \u2013 Turn off the base.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">drop database [AdventureWorks2017 ]<\/pre>\n\n\n\n<p>5 \u2013 We run the script that creates the database from step 1.<\/p>\n\n\n\n<p>6 \u2013 We change the collation in the base.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">ALTER DATABASE AdventureWorks2017 GREEK_CI_AI ;GO<\/pre>\n\n\n\n<p>7 \u2013 We execute it <strong>bcp in<\/strong> in command prompt from step 2. (after first disabling the constraints)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">EXEC sp_msforeachtable \"ALTER TABLE ? NOCHECK CONSTRAINT all\"<\/pre>\n\n\n\n<p>8 \u2013 When the bcp in is completed, enable the constraints.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">EXEC sp_msforeachtable \"ALTER TABLE ? CHECK CONSTRAINT all\"<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">To change the collation on the system bases<\/h2>\n\n\n\n<p>To change the collation in the system bases it is necessary<strong> rebuild<\/strong> the <strong>master&nbsp;<\/strong>and this results in:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>May all be lost <strong>jobs <\/strong>from <strong>msdb<\/strong><\/li>\n\n\n\n<li>May all be lost <strong>logins<\/strong> kai oi <strong>clock<\/strong><\/li>\n\n\n\n<li>Let them be lost <strong>dblinks<\/strong><\/li>\n\n\n\n<li>To lose all the rights that have been passed to the roles such as e.g. to the public<\/li>\n\n\n\n<li>To be done <strong>detach <\/strong>All the<strong> user databases<\/strong><\/li>\n\n\n\n<li>Let them all perish <strong>the parameters<\/strong>&nbsp;of the instance (which we had in sp_configure) such as max_memory, max_dop etc.<\/li>\n<\/ul>\n\n\n\n<p>The procedure for changing the collation in systemic ones is as follows:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>1 &#8211; <strong>Backup&nbsp;<\/strong>of the master, msdb, model databases (with the corresponding modification of the paths in the following script that I have made)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">DECLARE @date CHAR(8)\nSET @date = (SELECT CONVERT(char(8), GETDATE(), 112))\n\nDECLARE @backup_loc VARCHAR(125)  \nSET @backup_loc = 'X:\\backups\\'  -- \u03a3\u03b5 \u03c0\u03bf\u03b9\u03ac \u03c4\u03bf\u03c0\u03bf\u03b8\u03b5\u03c3\u03af\u03b1 \u03b8\u03b1 \u03c0\u03b1\u03c1\u03b8\u03bf\u03cd\u03bd \u03c4\u03b1 backups\n\nDECLARE @rest_dbf VARCHAR(125)\nSET @rest_dbf = 'D:\\Databases\\'   -- \u03a3\u03b5 \u03c0\u03bf\u03b9\u03ac \u03c4\u03bf\u03c0\u03bf\u03b8\u03b5\u03c3\u03af\u03b1 \u03b8\u03b1 \u03b3\u03af\u03bd\u03bf\u03c5\u03bd restore \u03c4\u03b1 datafiles\n\nDECLARE @rest_log VARCHAR(125)\nSET @rest_log = 'L:\\Logfiles\\';  -- \u03a3\u03b5 \u03c0\u03bf\u03b9\u03b1 \u03c4\u03bf\u03c0\u03bf\u03b8\u03b5\u03c3\u03af\u03b1 \u03b8\u03b1 \u03b3\u03af\u03bd\u03bf\u03c5\u03bd restore \u03c4\u03b1 logfiles\n\n\nWITH CTE ( DatabaseName, Npath )\n          AS ( SELECT DISTINCT\n                        DB_NAME(database_id) ,\n                        STUFF((SELECT   ' ' + CHAR(13)+', MOVE ''' + name + ''''\n                                        + CASE Type\n                                            WHEN 0 THEN ' TO ' +@rest_dbf\n                                            ELSE ' TO ' +@rest_log\n                                          END\n                                        + REVERSE(LEFT(REVERSE(physical_name),\n                                                       CHARINDEX('\\',\n                                                              REVERSE(physical_name),\n                                                              1) - 1)) + ''''\n                               FROM     sys.master_files sm1\n                               WHERE    sm1.database_id = sm2.database_ID\n                        FOR   XML PATH('') ,\n                                  TYPE).value('.', 'varchar(max)'), 1, 1, '') AS Npath\n               FROM     sys.master_files sm2\n  )\n--select * from CTE\nSELECT\n    'BACKUP DATABASE ' + name + ' TO DISK = ''' + @backup_loc + '' + name + '_' + @date + '.bak'' WITH COMPRESSION, COPY_ONLY, STATS=5' as Backup_Commands_onSource,\n    'RESTORE DATABASE '+ name + ' FROM DISK = ''' + @backup_loc + '' + name + '_' + @date + '.bak'' WITH RECOVERY, REPLACE, STATS=5 ' + CTE.Npath as Restore_Commands_onTarget\nFROM sys.databases d\n    INNER JOIN CTE ON d.name = cte.databasename\nWHERE d.name in('master','model','msdb') --DBs\nGO<\/pre>\n\n\n\n<p>2 &#8211;&nbsp;<strong>Backup of jobs<\/strong> (press F7 in SSMS to open the object explorer details, select all jobs and right click, script job as, create to, file.. as in the image below):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"612\" height=\"178\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/4-col.png\" alt=\"\" class=\"wp-image-1133\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/4-col.png 612w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/4-col-300x87.png 300w\" sizes=\"auto, (max-width: 612px) 100vw, 612px\" \/><\/figure>\n\n\n\n<p>3 \u2013 Backup logins, users, roles with Greg Ryan&#039;s query:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">--Script All Logins \/ Users \/ and Roles\n\n\/****************************************************************\nThis Script Generates A script to Create all Logins, Server Roles\n, DB Users and DB roles on a SQL Server\n\nGreg Ryan\n\n10\/31\/2013\n****************************************************************\/\nSET NOCOUNT ON\n\nDECLARE\n        @sql nvarchar(max)\n,       @Line int = 1\n,       @max int = 0\n,       @@CurDB nvarchar(100) = ''\n\nCREATE TABLE #SQL\n       (\n        Idx int IDENTITY\n       ,xSQL nvarchar(max)\n       )\n\nINSERT INTO #SQL\n        ( xSQL\n        )\n        SELECT\n                'IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = N'''\n                + QUOTENAME(name) + ''')\n' + '\tCREATE LOGIN ' + QUOTENAME(name) + ' WITH PASSWORD='\n                + sys.fn_varbintohexstr(password_hash) + ' HASHED, SID='\n                + sys.fn_varbintohexstr(sid) + ', ' + 'DEFAULT_DATABASE='\n                + QUOTENAME(COALESCE(default_database_name , 'master'))\n                + ', DEFAULT_LANGUAGE='\n                + QUOTENAME(COALESCE(default_language_name , 'us_english'))\n                + ', CHECK_EXPIRATION=' + CASE is_expiration_checked\n                                            WHEN 1 THEN 'ON'\n                                            ELSE 'OFF'\n                                          END + ', CHECK_POLICY='\n                + CASE is_policy_checked\n                    WHEN 1 THEN 'ON'\n                    ELSE 'OFF'\n                  END + '\nGo\n\n'\n            FROM\n                sys.sql_logins\n            WHERE\n                name &lt;> 'sa'\n\nINSERT INTO #SQL\n        ( xSQL\n        )\n        SELECT\n                'IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = N'''\n                + QUOTENAME(name) + ''')\n' + '\tCREATE LOGIN ' + QUOTENAME(name) + ' FROM WINDOWS WITH '\n                + 'DEFAULT_DATABASE='\n                + QUOTENAME(COALESCE(default_database_name , 'master'))\n                + ', DEFAULT_LANGUAGE='\n                + QUOTENAME(COALESCE(default_language_name , 'us_english'))\n                + ';\nGo\n\n'\n            FROM\n                sys.server_principals\n            WHERE\n                type IN ( 'U' , 'G' )\n                AND name NOT IN ( 'BUILTIN\\Administrators' ,\n                                  'NT AUTHORITY\\SYSTEM' );\n                                  \nPRINT '\/*****************************************************************************************\/'\nPRINT '\/*************************************** Create Logins ***********************************\/'\nPRINT '\/*****************************************************************************************\/'\nSELECT\n        @Max = MAX(idx)\n    FROM\n        #SQL \nWHILE @Line &lt;= @max\n      BEGIN\n\n\n\n            SELECT\n                    @sql = xSql\n                FROM\n                    #SQL AS s\n                WHERE\n                    idx = @Line\n            PRINT @sql\n\n            SET @line = @line + 1\n        \n      END\nDROP TABLE #SQL\n\nCREATE TABLE #SQL2\n       (\n        Idx int IDENTITY\n       ,xSQL nvarchar(max)\n       )\n\nINSERT INTO #SQL2\n        ( xSQL\n        )\n        SELECT\n                'EXEC sp_addsrvrolemember ' + QUOTENAME(L.name) + ', '\n                + QUOTENAME(R.name) + ';\nGO\n\n'\n            FROM\n                sys.server_principals L\n            JOIN sys.server_role_members RM\n            ON  L.principal_id = RM.member_principal_id\n            JOIN sys.server_principals R\n            ON  RM.role_principal_id = R.principal_id\n            WHERE\n                L.type IN ( 'U' , 'G' , 'S' )\n                AND L.name NOT IN ( 'BUILTIN\\Administrators' ,\n                                    'NT AUTHORITY\\SYSTEM' , 'sa' );\n\n\nPRINT '\/*****************************************************************************************\/'\nPRINT '\/******************************Add Server Role Members     *******************************\/'\nPRINT '\/*****************************************************************************************\/'\nSELECT\n        @Max = MAX(idx)\n    FROM\n        #SQL2 \nSET @line = 1\nWHILE @Line &lt;= @max\n      BEGIN\n\n\n\n            SELECT\n                    @sql = xSql\n                FROM\n                    #SQL2 AS s\n                WHERE\n                    idx = @Line\n            PRINT @sql\n\n            SET @line = @line + 1\n        \n      END\nDROP TABLE #SQL2\n\nPRINT '\/*****************************************************************************************\/'\nPRINT '\/*****************Add User and Roles membership to Indivdual Databases********************\/'\nPRINT '\/*****************************************************************************************\/'\n\n\n--Drop Table #Db\nCREATE TABLE #Db\n       (\n        idx int IDENTITY\n       ,DBName nvarchar(100)\n       );\n\n\n\nINSERT INTO #Db\n        SELECT\n                name\n            FROM\n                master.dbo.sysdatabases\n            WHERE\n                name NOT IN ( 'Master' , 'Model' , 'msdb' , 'tempdb' )\n            ORDER BY\n                name;\n\n\nSELECT\n        @Max = MAX(idx)\n    FROM\n        #Db\nSET @line = 1\n--Select * from #Db\n\n\n--Exec sp_executesql @SQL\n\nWHILE @line &lt;= @Max\n      BEGIN\n            SELECT\n                    @@CurDB = DBName\n                FROM\n                    #Db\n                WHERE\n                    idx = @line\n\n            SET @SQL = 'Use ' + @@CurDB + '\n\nDeclare  @@Script NVarChar(4000) = ''''\nDECLARE cur CURSOR FOR\n\nSelect  ''Use ' + @@CurDB + ';\nGo\nIF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'''''' +\n                mp.[name] + '''''')\nCREATE USER ['' + mp.[name] + ''] FOR LOGIN ['' +mp.[name] + ''] WITH DEFAULT_SCHEMA=[dbo]; ''+ CHAR(13)+CHAR(10) +\n''GO'' + CHAR(13)+CHAR(10) +\n\n''EXEC sp_addrolemember N'''''' + rp.name + '''''', N''''['' + mp.[name] + '']''''; \nGo''  \nFROM sys.database_role_members a\nINNER JOIN sys.database_principals rp ON rp.principal_id = a.role_principal_id\nINNER JOIN sys.database_principals AS mp ON mp.principal_id = a.member_principal_id\n\n\nOPEN cur\n\nFETCH NEXT FROM cur INTO @@Script;\nWHILE @@FETCH_STATUS = 0\nBEGIN   \nPRINT @@Script\nFETCH NEXT FROM cur INTO @@Script;\nEND\n\nCLOSE cur;\nDEALLOCATE cur;';\n--Print @SQL\nExec sp_executesql @SQL;\n--Set @@Script = ''\n            SET @Line = @Line + 1\n\n      END\n\nDROP TABLE #Db<\/pre>\n\n\n\n<p>4 \u2013 Backup&nbsp;<strong>db links<\/strong>, <strong>certificates <\/strong>(If they exist). It can be easily done with the SSMS GUI.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"404\" height=\"180\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/5-col.png\" alt=\"\" class=\"wp-image-1134\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/5-col.png 404w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/5-col-300x134.png 300w\" sizes=\"auto, (max-width: 404px) 100vw, 404px\" \/><\/figure>\n\n\n\n<p>5 \u2013 We do <strong>detach <\/strong>bases with the following script we can automate it:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">USE [master];\nGO\nDECLARE @database NVARCHAR(200) ,\n@cmd NVARCHAR(1000) ,\n@detach_cmd NVARCHAR(4000) ,\n@attach_cmd NVARCHAR(4000) ,\n@file NVARCHAR(1000) ,\n@i INT ,\n@whichdb INT=0,\n@dbname nvarchar(200)='%%',\n@Drive_Now nvarchar(10)='',\n@Drive_New nvarchar(10)='';\ncreate table #tempattach(attach_script varchar(max));\ncreate table #tempdetach(detach_script varchar(max));\n\n--set 4 for only userdbs, 0 for all dbs\nset @whichdb = 4\n\n--if u want to attach db on new drive with same path uncomment with the correct drive letters\n--set @Drive_Now = 'C:\\' set @Drive_New = 'Z:\\'\n\n--uncomment if u pick only one DBname\n--set @dbname = '%iDBA%'\n\nDECLARE dbname_cur CURSOR STATIC LOCAL FORWARD_ONLY\nFOR\nSELECT RTRIM(LTRIM([name]))\nFROM sys.databases\nWHERE database_id > @whichdb\nand name like @dbname;\n\nOPEN dbname_cur\n\nFETCH NEXT FROM dbname_cur INTO @database\n\nWHILE @@FETCH_STATUS = 0\nBEGIN\nSELECT @i = 1;    \nSET @attach_cmd = \n        'EXEC sp_attach_db @dbname = ''' + @database + '''' + CHAR(10);\n  -- Change skip checks to false if you want to update statistics before you detach.\n    SET @detach_cmd =\n        'EXEC sp_detach_db @dbname = ''' + @database\n        + ''' , @skipchecks = ''true'';' + CHAR(10);\n\n  -- Get a list of files for the database\n    DECLARE dbfiles_cur CURSOR STATIC LOCAL FORWARD_ONLY\n    FOR\n        SELECT  physical_name\n        FROM    sys.master_files\n        WHERE   database_id = DB_ID(@database)\n        ORDER BY [file_id];\n\n    OPEN dbfiles_cur\n\n    FETCH NEXT FROM dbfiles_cur INTO @file\n\n    WHILE @@FETCH_STATUS = 0 \n        BEGIN\n            SET @attach_cmd = @attach_cmd + '    ,@filename'\n                + CAST(@i AS NVARCHAR(10)) + ' = ''' + @file + ''''\n                + CHAR(10);\n            SET @i = @i + 1;\n\n            FETCH NEXT FROM dbfiles_cur INTO @file\n        END\n\n    CLOSE dbfiles_cur;\n\n    DEALLOCATE dbfiles_cur; \n   insert into #tempattach values(REPLACE(@attach_cmd,@Drive_Now,@Drive_New));\n   insert into #tempdetach values(@detach_cmd);\n\n    FETCH NEXT FROM dbname_cur INTO @database\nEND\nCLOSE dbname_cur;\n\nDEALLOCATE dbname_cur;\n\nselect * from #tempdetach\nselect * from #tempattach\n\ndrop table #tempattach\ndrop table #tempdetach<\/pre>\n\n\n\n<p>6 \u2013 Double click on the SQL Server ISO whose instance it is, e.g. 2016<\/p>\n\n\n\n<p>7 \u2013 In the command prompt as an administrator, cd to the drive where the ISO was mounted and run the following command, after first putting the correct instance name, windows authentication, and the collation we want to go to:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\"> F:\\>cd F:\n\nSetup \/QUIET \/ACTION=REBUILDDATABASE \/INSTANCENAME=MSSQLSERVER \/SQLSYSADMINACCOUNTS=INSTANCENAME\\SA \/SAPWD=KWDIKOS \/SQLCOLLATION=SQL_Latin1_General_CP1253_CI_AI<\/pre>\n\n\n\n<p>8 \u2013 The change is complete, so we have to go through the jobs, logins, parameters, etc. again.<\/p>\n\n\n\n<p>9 &#8211; <strong>Attach <\/strong>the user databases. (from the results of step 5)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sources:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/collations\/collation-and-unicode-support?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">Collation and Unicode support<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>In one sentence, collation is the way characters are encoded in a database. That is, you define whether they will be case sensitive (uppercase, lowercase), in which language the varchar and text fields are. Fields like nvarchar which are in Unicode format are not affected by the encoding of the characters, but it affects the sort since depending on the collation there can be a different order of letters [\u2026]<\/p>","protected":false},"author":1,"featured_media":702,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,15],"tags":[154,29,23,30,39,6],"class_list":["post-1132","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases","category-ms-sqlserver","tag-collation","tag-databases","tag-microsoft","tag-rdbms","tag-sql","tag-sqlserver"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u03a4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf collation \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b1\u03bb\u03bb\u03ac\u03b6\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dataplatform.gr\/en\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u03a4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf collation \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b1\u03bb\u03bb\u03ac\u03b6\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr\" \/>\n<meta property=\"og:description\" content=\"\u039c\u03b5 \u03bc\u03af\u03b1 \u03c0\u03c1\u03cc\u03c4\u03b1\u03c3\u03b7 \u03c4\u03bf collation \u03b5\u03af\u03bd\u03b1\u03b9&nbsp;\u03bf \u03c4\u03c1\u03cc\u03c0\u03bf\u03c2 \u03c0\u03bf\u03c5&nbsp;&nbsp; \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03c0\u03bf\u03b9\u03bf\u03cd\u03bd\u03c4\u03b1\u03b9 \u03bf\u03b9 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2&nbsp;\u03c3\u03b5 \u03bc\u03af\u03b1 \u03b2\u03ac\u03c3\u03b7 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd. \u039f\u03c1\u03af\u03b6\u03b5\u03c4\u03b5&nbsp;\u03b4\u03b7\u03bb\u03b1\u03b4\u03ae \u03b1\u03bd&nbsp;\u03b8\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 case sensitive&nbsp; (\u03ba\u03b5\u03c6\u03b1\u03bb\u03b1\u03af\u03b1, \u03bc\u03b9\u03ba\u03c1\u03ac), \u03c3\u03b5 \u03c4\u03b9 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9&nbsp;\u03c4\u03b1 \u03c0\u03b5\u03b4\u03af\u03b1 varchar \u03ba\u03b1\u03b9 text. \u03a0\u03b5\u03b4\u03af\u03b1 \u03cc\u03c0\u03c9\u03c2 nvarchar \u03c0\u03bf\u03c5 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c3\u03b5 Unicode \u03bc\u03bf\u03c1\u03c6\u03ae \u03b4\u03b5\u03bd \u03b5\u03c0\u03b7\u03c1\u03b5\u03ac\u03b6\u03bf\u03bd\u03c4\u03b1\u03b9 \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7&nbsp;\u03c4\u03c9\u03bd \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03c9\u03bd, \u03b1\u03bb\u03bb\u03ac \u03b5\u03c0\u03b7\u03c1\u03b5\u03ac\u03b6\u03b5\u03b9&nbsp;\u03c4\u03bf sort \u03b1\u03c6\u03bf\u03cd \u03b1\u03bd\u03ac\u03bb\u03bf\u03b3\u03b1 \u03c4\u03bf&nbsp;collation \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9 \u03b4\u03b9\u03b1\u03c6\u03bf\u03c1\u03b5\u03c4\u03b9\u03ba\u03ae&nbsp; \u03c3\u03b5\u03b9\u03c1\u03ac&nbsp; \u03b3\u03c1\u03b1\u03bc\u03bc\u03ac\u03c4\u03c9\u03bd [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dataplatform.gr\/en\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"DataPlatform.gr\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dataplatform.gr\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-23T05:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-27T13:17:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Stratos Matzouranis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stratos Matzouranis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/\"},\"author\":{\"name\":\"Stratos Matzouranis\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\"},\"headline\":\"\u03a4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf collation \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b1\u03bb\u03bb\u03ac\u03b6\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd SQL Server\",\"datePublished\":\"2021-08-23T05:00:00+00:00\",\"dateModified\":\"2023-08-27T13:17:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/\"},\"wordCount\":266,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"keywords\":[\"Collation\",\"Databases\",\"Microsoft\",\"RDBMS\",\"SQL\",\"SQL Server\"],\"articleSection\":[\"Databases\",\"Microsoft SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/\",\"name\":\"\u03a4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf collation \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b1\u03bb\u03bb\u03ac\u03b6\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"datePublished\":\"2021-08-23T05:00:00+00:00\",\"dateModified\":\"2023-08-27T13:17:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/databases\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Microsoft SQL Server\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/databases\\\/ms-sqlserver\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\u03a4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf collation \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b1\u03bb\u03bb\u03ac\u03b6\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd SQL Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"name\":\"dataplatform.gr - Sky is not the limit!\",\"description\":\"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dataplatform.gr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\",\"name\":\"dataplatform.gr\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"width\":322,\"height\":139,\"caption\":\"dataplatform.gr\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dataplatform.gr\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dataplatform-gr\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\",\"name\":\"Stratos Matzouranis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"caption\":\"Stratos Matzouranis\"},\"sameAs\":[\"https:\\\/\\\/www.dataplatform.gr\"],\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/en\\\/author\\\/stratos-matzouranis\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u03a4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf collation \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b1\u03bb\u03bb\u03ac\u03b6\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dataplatform.gr\/en\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"\u03a4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf collation \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b1\u03bb\u03bb\u03ac\u03b6\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr","og_description":"\u039c\u03b5 \u03bc\u03af\u03b1 \u03c0\u03c1\u03cc\u03c4\u03b1\u03c3\u03b7 \u03c4\u03bf collation \u03b5\u03af\u03bd\u03b1\u03b9&nbsp;\u03bf \u03c4\u03c1\u03cc\u03c0\u03bf\u03c2 \u03c0\u03bf\u03c5&nbsp;&nbsp; \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03c0\u03bf\u03b9\u03bf\u03cd\u03bd\u03c4\u03b1\u03b9 \u03bf\u03b9 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2&nbsp;\u03c3\u03b5 \u03bc\u03af\u03b1 \u03b2\u03ac\u03c3\u03b7 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd. \u039f\u03c1\u03af\u03b6\u03b5\u03c4\u03b5&nbsp;\u03b4\u03b7\u03bb\u03b1\u03b4\u03ae \u03b1\u03bd&nbsp;\u03b8\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 case sensitive&nbsp; (\u03ba\u03b5\u03c6\u03b1\u03bb\u03b1\u03af\u03b1, \u03bc\u03b9\u03ba\u03c1\u03ac), \u03c3\u03b5 \u03c4\u03b9 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9&nbsp;\u03c4\u03b1 \u03c0\u03b5\u03b4\u03af\u03b1 varchar \u03ba\u03b1\u03b9 text. \u03a0\u03b5\u03b4\u03af\u03b1 \u03cc\u03c0\u03c9\u03c2 nvarchar \u03c0\u03bf\u03c5 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c3\u03b5 Unicode \u03bc\u03bf\u03c1\u03c6\u03ae \u03b4\u03b5\u03bd \u03b5\u03c0\u03b7\u03c1\u03b5\u03ac\u03b6\u03bf\u03bd\u03c4\u03b1\u03b9 \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7&nbsp;\u03c4\u03c9\u03bd \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03c9\u03bd, \u03b1\u03bb\u03bb\u03ac \u03b5\u03c0\u03b7\u03c1\u03b5\u03ac\u03b6\u03b5\u03b9&nbsp;\u03c4\u03bf sort \u03b1\u03c6\u03bf\u03cd \u03b1\u03bd\u03ac\u03bb\u03bf\u03b3\u03b1 \u03c4\u03bf&nbsp;collation \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9 \u03b4\u03b9\u03b1\u03c6\u03bf\u03c1\u03b5\u03c4\u03b9\u03ba\u03ae&nbsp; \u03c3\u03b5\u03b9\u03c1\u03ac&nbsp; \u03b3\u03c1\u03b1\u03bc\u03bc\u03ac\u03c4\u03c9\u03bd [&hellip;]","og_url":"https:\/\/www.dataplatform.gr\/en\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/","og_site_name":"DataPlatform.gr","article_publisher":"https:\/\/www.facebook.com\/dataplatform.gr\/","article_published_time":"2021-08-23T05:00:00+00:00","article_modified_time":"2023-08-27T13:17:19+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","type":"image\/png"}],"author":"Stratos Matzouranis","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stratos Matzouranis","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/#article","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/"},"author":{"name":"Stratos Matzouranis","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf"},"headline":"\u03a4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf collation \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b1\u03bb\u03bb\u03ac\u03b6\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd SQL Server","datePublished":"2021-08-23T05:00:00+00:00","dateModified":"2023-08-27T13:17:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/"},"wordCount":266,"commentCount":4,"publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"image":{"@id":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","keywords":["Collation","Databases","Microsoft","RDBMS","SQL","SQL Server"],"articleSection":["Databases","Microsoft SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/","url":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/","name":"\u03a4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf collation \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b1\u03bb\u03bb\u03ac\u03b6\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/#primaryimage"},"image":{"@id":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","datePublished":"2021-08-23T05:00:00+00:00","dateModified":"2023-08-27T13:17:19+00:00","breadcrumb":{"@id":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/#primaryimage","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/www.dataplatform.gr\/ti-einai-to-collation-kai-pos-allazei-ston-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae","item":"https:\/\/www.dataplatform.gr\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/www.dataplatform.gr\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"Microsoft SQL Server","item":"https:\/\/www.dataplatform.gr\/category\/databases\/ms-sqlserver\/"},{"@type":"ListItem","position":4,"name":"\u03a4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03bf collation \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b1\u03bb\u03bb\u03ac\u03b6\u03b5\u03b9 \u03c3\u03c4\u03bf\u03bd SQL Server"}]},{"@type":"WebSite","@id":"https:\/\/www.dataplatform.gr\/#website","url":"https:\/\/www.dataplatform.gr\/","name":"dataplatform.gr - Sky is not the limit!","description":"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.","publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dataplatform.gr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dataplatform.gr\/#organization","name":"dataplatform.gr","url":"https:\/\/www.dataplatform.gr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","width":322,"height":139,"caption":"dataplatform.gr"},"image":{"@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dataplatform.gr\/","https:\/\/www.linkedin.com\/company\/dataplatform-gr\/"]},{"@type":"Person","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf","name":"Stratos Matzouranis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","caption":"Stratos Matzouranis"},"sameAs":["https:\/\/www.dataplatform.gr"],"url":"https:\/\/www.dataplatform.gr\/en\/author\/stratos-matzouranis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/1132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/comments?post=1132"}],"version-history":[{"count":3,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/1132\/revisions"}],"predecessor-version":[{"id":5560,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/1132\/revisions\/5560"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media\/702"}],"wp:attachment":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media?parent=1132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/categories?post=1132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/tags?post=1132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}