Link to home
Start Free TrialLog in
Avatar of countrymeister
countrymeister

asked on

Collation error on adding of a new column

One of our team members added a new column to the table tblOrders, now we get an collation error on a select condition where there is a JOIN with another table

This was the change that was made
exec sp_repladdcolumn 'tblOrders',  'orderregion',        'varchar(60)      NULL'


exec sp_recompile tblOrders

Not sure what is the reason this is occuring, and how do we fix it
Avatar of lcohan
lcohan
Flag of Canada image

You will need to check the collation on the older existing table and issue an ALTER TABLE ALTER COLUMN statement on the newly added column to match the other table column collation.
It will be a statement like below that you need to write and execute in SQL where collation_name
will be the name of the collation of the old table.column


ALTER TABLE database_name.schemaname.table_name
    ALTER COLUMN column_name data_type()
        COLLATE collation_name
ASKER CERTIFIED SOLUTION
Avatar of countrymeister
countrymeister

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of countrymeister
countrymeister

ASKER

dropped the new column that was created