We help IT Professionals succeed at work.

Collation error on adding of a new column

Medium Priority
287 Views
Last Modified: 2012-05-11
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
Comment
Watch Question

lcohanDatabase Analyst
CERTIFIED EXPERT

Commented:
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.
lcohanDatabase Analyst
CERTIFIED EXPERT

Commented:
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
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
dropped the new column that was created
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.