• <bdo id='CJ3wt'></bdo><ul id='CJ3wt'></ul>
  1. <legend id='CJ3wt'><style id='CJ3wt'><dir id='CJ3wt'><q id='CJ3wt'></q></dir></style></legend>

    <small id='CJ3wt'></small><noframes id='CJ3wt'>

      <i id='CJ3wt'><tr id='CJ3wt'><dt id='CJ3wt'><q id='CJ3wt'><span id='CJ3wt'><b id='CJ3wt'><form id='CJ3wt'><ins id='CJ3wt'></ins><ul id='CJ3wt'></ul><sub id='CJ3wt'></sub></form><legend id='CJ3wt'></legend><bdo id='CJ3wt'><pre id='CJ3wt'><center id='CJ3wt'></center></pre></bdo></b><th id='CJ3wt'></th></span></q></dt></tr></i><div id='CJ3wt'><tfoot id='CJ3wt'></tfoot><dl id='CJ3wt'><fieldset id='CJ3wt'></fieldset></dl></div>

    1. <tfoot id='CJ3wt'></tfoot>

      尽管每列都使用了 varchar(MAX),但在导入 CSV 文件时 SQL Server 中出现错误

      Errors in SQL Server while importing CSV file despite varchar(MAX) being used for each column(尽管每列都使用了 varchar(MAX),但在导入 CSV 文件时 SQL Server 中出现错误)
      <i id='vSBv5'><tr id='vSBv5'><dt id='vSBv5'><q id='vSBv5'><span id='vSBv5'><b id='vSBv5'><form id='vSBv5'><ins id='vSBv5'></ins><ul id='vSBv5'></ul><sub id='vSBv5'></sub></form><legend id='vSBv5'></legend><bdo id='vSBv5'><pre id='vSBv5'><center id='vSBv5'></center></pre></bdo></b><th id='vSBv5'></th></span></q></dt></tr></i><div id='vSBv5'><tfoot id='vSBv5'></tfoot><dl id='vSBv5'><fieldset id='vSBv5'></fieldset></dl></div>
        • <bdo id='vSBv5'></bdo><ul id='vSBv5'></ul>

            <tfoot id='vSBv5'></tfoot>
          • <legend id='vSBv5'><style id='vSBv5'><dir id='vSBv5'><q id='vSBv5'></q></dir></style></legend>

                <tbody id='vSBv5'></tbody>

              <small id='vSBv5'></small><noframes id='vSBv5'>

                本文介绍了尽管每列都使用了 varchar(MAX),但在导入 CSV 文件时 SQL Server 中出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试将一个大型 CSV 文件(几个演出)插入 SQL Server,但是一旦我通过 Import Wizard 并最终尝试导入文件我收到以下错误报告:

                I'm trying to insert a large CSV file (several gigs) into SQL Server, but once I go through the Import Wizard and finally try to import the file I get the following error report:

                • 正在执行(错误)消息

                错误 0xc02020a1:数据流任务 1:数据转换失败.数据标题"列的转换返回状态值 4 和状态text "文本被截断或一个或多个字符在目标代码页.".

                Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column ""Title"" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

                (SQL Server 导入导出向导)

                错误 0xc020902a:数据流任务 1:源 -Train_csv.Outputs[平面文件源输出].Columns["Title"]"失败因为发生了截断,并且截断行处置"源 - Train_csv.Outputs[平面文件源输出].Columns["Title"]"指定截断失败.发生截断错误指定组件的指定对象.

                Error 0xc020902a: Data Flow Task 1: The "Source - Train_csv.Outputs[Flat File Source Output].Columns["Title"]" failed because truncation occurred, and the truncation row disposition on "Source - Train_csv.Outputs[Flat File Source Output].Columns["Title"]" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.

                (SQL Server 导入导出向导)

                错误 0xc0202092:数据流任务 1:处理时发生错误数据行 2 上的文件C:Train.csv".

                Error 0xc0202092: Data Flow Task 1: An error occurred while processing file "C:Train.csv" on data row 2.

                (SQL Server 导入导出向导)

                错误 0xc0047038:数据流任务 1:SSIS 错误代码DTS_E_PRIMEOUTPUFAILED.Source 上的 PrimeOutput 方法 - Train_csv返回错误代码 0xC0202092.组件返回失败代码当管道引擎调用 PrimeOutput() 时.的意义失败代码由组件定义,但错误是致命的并且管道停止执行.可能会发布错误消息在此之前提供有关失败的更多信息.

                Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on Source - Train_csv returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.

                (SQL Server 导入导出向导)

                我首先创建了将文件插入的表,并将每一列设置为保存 varchar(MAX),所以我不明白我怎么仍然会遇到这个截断问题.我做错了什么?

                I created the table to insert the file into first, and I set each column to hold varchar(MAX), so I don't understand how I can still have this truncation issue. What am I doing wrong?

                推荐答案

                在 SQL Server 导入和导出向导中,您可以在 Advanced 选项卡中调整源数据类型(这些成为如果创建新表则输出,否则仅用于处理源数据).

                In SQL Server Import and Export Wizard you can adjust the source data types in the Advanced tab (these become the data types of the output if creating a new table, but otherwise are just used for handling the source data).

                数据类型与 MS SQL 中的数据类型不同,而不是 VARCHAR(255) 它是 DT_STR 并且输出列宽可以设置为 255.对于 VARCHAR(MAX),它是 DT_TEXT.

                The data types are annoyingly different than those in MS SQL, instead of VARCHAR(255) it's DT_STR and the output column width can be set to 255. For VARCHAR(MAX) it's DT_TEXT.

                因此,在数据源选择的Advanced 选项卡中,将任何违规列的数据类型从DT_STR 更改为DT_TEXT(您可以选择多个列并一次更改它们).

                So, on the Data Source selection, in the Advanced tab, change the data type of any offending columns from DT_STR to DT_TEXT (You can select multiple columns and change them all at once).

                这篇关于尽管每列都使用了 varchar(MAX),但在导入 CSV 文件时 SQL Server 中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Building a comma separated list?(建立一个逗号分隔的列表?)
                How can I import an Excel file into SQL Server?(如何将 Excel 文件导入 SQL Server?)
                Export table to file with column headers (column names) using the bcp utility and SQL Server 2008(使用 bcp 实用程序和 SQL Server 2008 将表导出到带有列标题(列名称)的文件)
                Concat field value to string in SQL Server(将字段值连接到 SQL Server 中的字符串)
                SQL Server Bulk insert of CSV file with inconsistent quotes(SQL Server 批量插入带有不一致引号的 CSV 文件)
                How to update a record using sequelize for node?(如何使用节点的 sequelize 更新记录?)
                <i id='2TDKC'><tr id='2TDKC'><dt id='2TDKC'><q id='2TDKC'><span id='2TDKC'><b id='2TDKC'><form id='2TDKC'><ins id='2TDKC'></ins><ul id='2TDKC'></ul><sub id='2TDKC'></sub></form><legend id='2TDKC'></legend><bdo id='2TDKC'><pre id='2TDKC'><center id='2TDKC'></center></pre></bdo></b><th id='2TDKC'></th></span></q></dt></tr></i><div id='2TDKC'><tfoot id='2TDKC'></tfoot><dl id='2TDKC'><fieldset id='2TDKC'></fieldset></dl></div>
                • <legend id='2TDKC'><style id='2TDKC'><dir id='2TDKC'><q id='2TDKC'></q></dir></style></legend>
                    <bdo id='2TDKC'></bdo><ul id='2TDKC'></ul>

                      1. <small id='2TDKC'></small><noframes id='2TDKC'>

                            <tbody id='2TDKC'></tbody>
                          <tfoot id='2TDKC'></tfoot>