Form Update Problem With Spaces


I have a problem with MSSQL, when I try to modify a column, the text field is automatically full with spaces, so I have to delete all the spaces to be able to make the update.

Someone know how to deal with this spaces generated by sql server or yii ?

Thanks for help.


Problem solved, I used nchar instead of nvarchar

Also, I always use make a trim filter as a first rule in my models’ rules() method.


what is the type of column in your sql ?

varchar or char ?