Invalid column name, column accents in MS SQL Server
I'm currently working with an old database that has column names containing accents. When I try to execute this query in Codeigniter (PHP):
SELECT *
FROM [empresas] [em]
LEFT JOIN [clientes] [cl] ON [em].[empresa] = [cl].[Código]
The system throws the error
"Invalid column name 'Código'". (the column name is 'Código')
I've tried using COLLATE
function with no success.
The MS SQL Server database default collation is Modern_Spanish_CI_AI
and the column collation is SQL_Latin1_General_CP1_CI_AS
.
How can I solve this problem?
Codeigniter has a configuration field name "dbcollation" that sets the collation used to communicate with the database but I don't know if it affects in this problem (I've tested some values with no success too).
Thank you.
您应该将数据库集合转换为utf8_general_ci
链接地址: http://www.djcxy.com/p/67830.html