• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

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
0
countrymeister
Asked:
countrymeister
  • 2
  • 2
1 Solution
 
lcohanDatabase AnalystCommented:
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.
0
 
lcohanDatabase AnalystCommented:
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
0
 
countrymeisterAuthor Commented:
I am not using the new column at all, in this particular stored procedure, this is an existing stored procedure, so now it fails with this database change
exec sp_repladdcolumn 'tblOrders',  'orderregion',        'varchar(60)      NULL'

with the collation error
0
 
countrymeisterAuthor Commented:
dropped the new column that was created
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now