D
D
DrFreez2014-01-17 10:56:45
Yii
DrFreez, 2014-01-17 10:56:45

yii + mssql. Russian language in the names of tables and fields, how to cure?

I'm connecting now

'db' => array(
            'class' => 'application.components.db.RDbConnection',
            'commandClass' => 'application.components.db.RDbCommand',
            'connectionString' => 'dblib:host=******;dbname=testdb',
            'username' => '*******',
            'password' => '*******',
            'tablePrefix' => '',
            'schemaCachingDuration' => YII_DEBUG ? 0 : 1000,
        ),

When you try to access a table with a Russian name, it crashes
CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[HY000]: General error: 102 General SQL Server error: Check messages from the SQL Server [102] (severity 15) [(null)]. The SQL statement executed was: SELECT TOP 10 * FROM testdb.dbo.сотрудники

$sql = 'SELECT TOP 10 * FROM testdb.dbo.сотрудники';
$data = Yii::app()->db->createCommand($sql)->queryAll();

When I refer to a table with a name in Latin, everything is in order. How to cure?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Kupreichik, 2014-01-17
@plusodinminus

Rename table in database. Minimum hemorrhoids.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question