BCP queryout 如何对 varbinary(max) 进行编码,我可以更改编码吗?

How does BCP queryout encode varbinary(max) and can I change the encoding?

我有一个遗留系统,它有图像字节数组 (jpg) 存储在数据库中的 varbinary(max) 列中。 sql bcp 使用什么默认编码来创建它写入平面文件的字符串?另外,我可以更改编码吗?

当您使用 bcp 输出时,默认格式是本机格式,或者您可以使用 -n 强制使用(-N 也可以,因为它将非字符数据存储为本机格式)。

Kalman Toth 的网站有一个例子 http://www.sqlusa.com/bestpractices/imageimportexport/