Collation error on adding of a new column

Posted on 2011-04-21
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
Question by:countrymeister
    LVL 39

    Expert Comment

    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.
    LVL 39

    Expert Comment

    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
    LVL 1

    Accepted Solution

    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
    LVL 1

    Author Closing Comment

    dropped the new column that was created

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now