Home > database >  Querying SQL Server on remote host arises a Character Set Problem
Querying SQL Server on remote host arises a Character Set Problem

Time:12-16

When calling to SQL SERVER on remote hosting with query below a problem occurs:

SELECT COLUMN_NAME, TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '..ş'

Table Names, having Local Culture Alphabet do not return in query, although they are in schema. For example, tables with Turkish Chars like 'ı' 'ş' not seen in query result...

CodePudding user response:

you have to set collation when creating or altering:

use master
ALTER DATABASE YourDataBase SET SINGLE_USER WITH ROLLBACK IMMEDIATE    
ALTER DATABASE YourDataBase COLLATE Turkish_CI_AS
ALTER DATABASE YourDataBase SET MULTI_USER

this time no need to use N' in each query.

  • Related