Problem with over linked server

I have a union view that when I try and access via a linked server connection returns the following message

Msg 7347, Level 16, State 1, Line 1
OLE DB provider 'SQLNCLI' for linked server 'CMPprd' returned data that does not match expected data length for column '[gp9prd].[company].[dbo].[sop10100_sop30200_union].ADDRESS1'. The (maximum) expected data length is 31, while the returned data length is 61.

The interesting thing is that when I look at the union view the column size for the Address1 field says 31 but both Address1 fields in the two tables being unioned have a size of 61.

The union itself has no defined restriction on the field sizes.

I have no problem with the union view except over the Linked server.

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.

lcohanDatabase AnalystCommented:
"The interesting thing is that when I look at the union view..."

I suggest you always CAST/CONVERT all output columns in a VIEW especially in a UNION for linked server - this way you won't have implicit conversion issues in drivers.

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

From novice to tech pro — start learning today.