BulkCopyfromsourcetabletodestinationtablewithacolumnwhosetyp

WBOY
Lepaskan: 2016-06-07 15:54:11
asal
1122 orang telah melayarinya

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

Label berkaitan:
sun
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!