首页 > 其他 > 详细

BulkCopy from source table to destination table with a column whose type is different

时间:2014-03-26 03:47:59      阅读:320      评论:0      收藏:0      [点我收藏+]

/*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!

BulkCopy from source table to destination table with a column whose type is different,布布扣,bubuko.com

BulkCopy from source table to destination table with a column whose type is different

原文:http://blog.csdn.net/garcon1986/article/details/22123965

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!