/*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!
本文讨论了在将数据从staging表复制到生产表时遇到的错误,即源列与目标列的数据类型不匹配。通过使用CONVERT函数解决了此问题,并提供了SQL查询示例。

3234

被折叠的 条评论
为什么被折叠?



