Home > Database > Mysql Tutorial > body text

BulkCopyfromsourcetabletodestinationtablewithacolumnwhosetyp

WBOY
Release: 2016-06-07 15:54:11
Original
1122 people have browsed it

/*Author: Jiangong SUN*/ Ive encountered a problem when I do a sql bulk copy from a table in staging to the same table in production. Except for a same column has different types. So when i synchronize the data, I have the following error:

/*Author: Jiangong SUN*/

I've encountered a problem when I do a sql bulk copy from a table in staging to the same table in production. Except for a same column has different types.

So when i synchronize the data, I have the following error:

The locale id '0' of the source column 'EntityId' and the locale id '1033' of thedestination column 'EntityId' do not match.

Whereas it's not the source of the error.

After strugling several hours, a solution is to use a CONVERT when I synchronize the data.

SELECT Id, CONVERT(varchar(60), EntityId) as EntityId FROM @TABLENAME WITH (NOLOCK) WHERE ID = @ID

Hope this helps!

Enjoy coding!

Related labels:
sun
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!