-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yii2 session table data column varbinary(BLOB) type not possible #19595
Comments
So After I update YII2 latest version and change session table -- "data" column to "varbinary" will this issue solved? Thanks |
You can be moved huge data to other table(s)/storage(s), then You can move huge data to another table(s) or storage(s), then
If you want keep stored data, then dump table data, re-create table and load dumped data, |
to "varbinary(max)", but I think better solution is separate huge data, then you can lazy-loads complex data. |
@WinterSilence I have tried varbinary(max) with truncate/clean table and re-create column. Still getting below error. PDOException: SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Implicit conversion from data type nvarchar to varbinary(max) is not allowed. Use the CONVERT function to run this query. in E:\Projects\sa\phpprojects\php8011.test\Ascriptica\vendor\yiisoft\yii2\db\Command.php:1302 Next yii\db\Exception: SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Implicit conversion from data type nvarchar to varbinary(max) is not allowed. Use the CONVERT function to run this query. |
I mean, drop column and add again with new type |
Yes, I did the same but no effect it throw the same error. |
Hello,
We have a strange problem, we are using MSSQL 2019 database for our project with YII2 latest version and storing session in database. Due to huge data in session, we can not use ntext, nvarchar(MAX) etc for the data column in the session table.
Yii2 recommend BLOB data type, but in the latest SQL server there no blob data type they have varbinary(max). When I set this YII2 gives SQL error Implicit conversion from data type nvarchar to varbinary(max) is not allowed
What should we do now ? as there is large data in session if we use nvarchar/ntext etc the data is truncated and we lost data in session.
Any help would appriciate.
Thanks
Additional info
The text was updated successfully, but these errors were encountered: