inserting from one table to another different descriptions

I am running the following script



UPDATE coa
SET account_description = [is].[New Account Description]
FROM dbo.coa b
inner jOIN dbo.coaimport [is]  ON
[is].[account code] = b.account_code

I am receiving this error

Msg 8152, Level 16, State 2, Line 1
String or binary data would be truncated.
The statement has been terminated.

I suspect my account team have gone to down with their descriptions....
and it is over the column limit, would that be right.
Amanda WalshawBusiness Solutions AnalsystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brian CroweDatabase AdministratorCommented:
You can cast or substring the source string once you determine which column is the issue.  You need to obtain the schema information for both tables before we can give you any more detailed direction.
0
PortletPaulfreelancerCommented:
>> it is over the column limit, would that be right.
yep.

could it be a change of data type perhaps?
e.g. account_description varchar and [new description] nvarchar

or that simply the old field is a smaller allowed length then the new
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott PletcherSenior DBACommented:
This will show you the account code, the new description that is too long, and the current description:


SELECT [is].[account code], [is].[New Account Description], b.account_description
FROM dbo.coa b
inner jOIN dbo.coaimport [is]  ON
    [is].[account code] = b.account_code
WHERE
    LEN([is].[New Account Description]) > COL_LENGTH('dbo.coa', 'account_description') --/2 --if datatype of account_description is nvarchar, divide by 2
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.