导入 varbinary 数据 [英] Import varbinary data

查看:21
本文介绍了导入 varbinary 数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们使用导出列 comp.(https://stackoverflow.com/questions/12712632/export-varbinarymax-column-with-ssis) 我们想将平面文件导入数据库.当我尝试导入 varbinary 列(甚至导入带有 varbinary 列的测试表)时,无缘无故地将 FF 字符添加到 varbinary 数据(在末尾).为了导入我在平面文件属性中选择的文件,下一个选项:unicode,未签名第一个数据行和列选项卡中的列名,我添加了一个 {|}{@}{|} 行分隔符以获得一列一行.当我运行 packg 时.在插入末尾带有 FF 的 varbinary 数据时,详细信息无效.你知道这些角色是从哪里出现的吗?

After we used the Export column comp.(https://stackoverflow.com/questions/12712632/export-varbinarymax-column-with-ssis) we want to import the flat file into the db. when i try to import the varbinary column (even to a test table with varbinary column) , an FF character are added to varbinary data (at the end ) with no reason . in order to import the file i choosed in the flat file properties the next options : unicode,unsigned the column names in the first data row and in columns tab i added a {|}{@}{|} row delimiter in order to get one row for one column . when i run the packg. in inserts the varbinary data with FF trailing at the end off course the details are invalid . do you have any idea from where these characters appeared ?

推荐答案

除非我误解了您的文件的布局(所有数据都在一个文件中)和 1 个文件 = 目标表中的 1 行.有了这个假设,您将需要按照我在 通过 SSIS 在 SQL 中插入 XML 文件

Unless I'm misunderstanding the layout of your file (all the data is in a single file) and 1 file = 1 row in the target table. With that assumption in place, you'll want to do much as I described in this answer on insert XML file in SQL via SSIS

在我记下在此记下 ID"的部分中,将数据类型从 NTEXT 更改为 IMAGE,其他所有内容都应该相同.

In the section where I note "Make note of the ID here" change the data type from NTEXT to IMAGE and everything else should work the same.

这篇关于导入 varbinary 数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆