我正在协助某人尝试将数据库从一种记录保存软件迁移到另一种。源是4gb + .mdf,我已将其导入SMSS2014,并尝试将其导出为.csv,因为这是目标软件从中导入的。这是一个准系统,默认SMSS安装,没有任何自定义,因为我对SMSS不太了解,但是我从技术角度理解工作流程。本机导出失败,并带有以下链接-由于<10个重复,无法发布直接的ss /图像。道歉。
https://i.imgur.com/qOOE6vq.png
查看详细信息时:
===================================
Could not connect destination component.
Error 0xc0204016: SSIS.Pipeline: The "Data Conversion 131 - 0.Outputs[Data Conversion Output].Columns[EntryText]" has a length that is not valid. The length must be between 0 and 4000.
(SQL Server Import and Export Wizard)
===================================
Exception from HRESULT: 0xC0204016 (Microsoft.SqlServer.DTSPipelineWrap)
------------------------------
Program Location:
at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.SetOutputColumnDataTypeProperties(Int32 lOutputID, Int32 lOutputColumnID, DataType eDataType, Int32 lLength, Int32 lPrecision, Int32 lScale, Int32 lCodePage)
at Microsoft.SqlServer.Dts.DtsWizard.Execute.AddConvertTransform(TransformInfo ti, Hashtable extColumnByLineageId, IDTSComponentMetaData100 previousConvert, Int32 stepNum)
at Microsoft.SqlServer.Dts.DtsWizard.Execute.CreateExplicitConvertTransform(TransformInfo ti, Hashtable extColumnByLineageId)
at Microsoft.SqlServer.Dts.DtsWizard.Execute.GenerateDestinationColumns(TransformInfo ti, IDTSDesigntimeComponent100 comp)
at Microsoft.SqlServer.Dts.DtsWizard.Execute.SetDestConnection(Exception& ex, TransformInfo ti)
导出步骤: 右键单击数据库->任务->导出数据...->选择源->我已经选择了SQL Server Native Client 11.0选项->设置服务器和数据库->目标:Excel 97-2003,检查第一行是否具有列名->设置保存路径->从一个或多个表或视图复制数据->全选->查看数据类型映射:这显示有问题的表。
据我所见,任何被转换为LongText的东西都将中断导出,似乎与源类型无关。我了解'...的长度无效。长度必须在0到4000之间。错误的意思是,但不确定如何解决。
在“审阅”步骤上双击转换项时,它们的列出类似于以下内容:
[Source Information]
Source Location : PCNAME\SERVER
Source Provider : SQLOLEDB
Table: [dbo].[Redacted]
Column: Redacted
Column Type: varchar
SSIS Type: string [DT_STR]
Mapping file (to SSIS type): C:\Program Files (x86)\Microsoft SQL Server\120\DTS\MappingFiles\MSSQLToSSIS10.XML
[Destination Information]
Destination Location : C:\Program Files (x86)\Forte Holdings\Chiro8000\Data\export.xls
Destination Provider : Microsoft.Jet.OLEDB.4.0
Table: `Redacted`
Column: Redacted
Column Type: LongText
SSIS Type: Unicode text stream [DT_NTEXT]
Mapping file (to SSIS type): C:\Program Files (x86)\Microsoft SQL Server\120\DTS\MappingFiles\JetToSSIS.xml
[Conversion Steps]
Step 1: DT_STR to DT_WSTR
SSIS conversion file: C:\Program Files (x86)\Microsoft SQL Server\120\DTS\binn\DtwTypeConversion.xml
我曾尝试对本文进行反向工程,但是导出上没有类似的高级选项:http://www.thesqlreport.com/?p=837
TL; DR:无法从SMSS导出到.csv,原因是: 错误0xc0204016:SSIS。管道:“数据转换131-0.Outputs [数据转换输出] .Columns [EntryText]”的长度无效。长度必须在0到4000之间。
预先感谢任何方向。