用SSIS导入Flat File Source时候出现这个错误,应该怎么处理?

mshack111 2023-03-04 14:48:58

小菜刚开始学mssql遇见两个问题无法解决,求救!

 

问题1:

在MSSM里面,数据库右键的菜单 选择 “导入数据”,在向导中,选择导入源,“Flat File Source” 立马就出现这个错误,请问应该怎么解决?

用这个向导,导入excel和mdb 都是可以的。

 

===================================

This wizard will close because it encountered the following error: (Microsoft SQL Server)

------------------------------
For help, click: https://go.microsoft.com:80/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=16.0.5107.0&EvtSrc=Microsoft.SqlServer.Management.UI.WizardFrameworkErrorSR&EvtID=UncaughtException&LinkId=20476

===================================

未将对象引用设置到对象的实例。 (System.Windows.Forms)

------------------------------
Program Location:

   在 System.Windows.Forms.PropertyGrid.set_SelectedObjects(Object[] value)
   在 System.Windows.Forms.PropertyGrid.set_SelectedObject(Object value)
   在 Microsoft.SqlServer.Dts.DtsWizard.AdoNetForm.Microsoft.SqlServer.Dts.DtsWizard.IDataSourceSubForm.OnEnterSubForm()
   在 Microsoft.SqlServer.Dts.DtsWizard.Step1.OnEnterPage(EventArgs e)
   在 Microsoft.SqlServer.Management.UI.WizardPage.RaiseEnterPage()
   在 Microsoft.SqlServer.Management.UI.WizardForm.NextPage(WizardPage nextPage)
   在 Microsoft.SqlServer.Management.UI.WizardForm.Next_Click(Object sender, EventArgs e)

 

 

 

 

问题2:如果直接导入“平面文件”,经常出现 System.OutOfMemoryException的问题,如果文本文件的比较小,就不会有问题,如果大一些往往就出错。

 

===================================

将数据插入到表中时出错。 (Microsoft.SqlServer.Import.Wizard)

------------------------------
程序位置:

   在 Microsoft.SqlServer.Import.Wizard.InsertData.ResultCheck(Result result)
   在 Microsoft.SqlServer.Import.Wizard.InsertData.DoWork()
   在 Microsoft.SqlServer.Management.TaskForms.SimpleWorkItem.Run()

===================================

将数据插入到表中时出错。 (Microsoft.SqlServer.Prose.Import)

------------------------------
程序位置:

   在 Microsoft.SqlServer.Prose.Import.BcpTextSynthesis.InsertIntoDB(String inputFilePath, String tableName, String schemaName, IReadOnlyList`1 columnInfo, SqlConnection connection, Int32 batchSize, SqlTransaction transaction, IList`1 allFinalTransformations, IList`1 allFinalTransformationColumns, IList`1 allFinalColNames)
   在 Microsoft.SqlServer.Prose.Import.BcpProcess.CreateTableAndInsertDataIntoDb(String connectionString, Int32 batchSize, String azureAccessToken)

===================================

引发类型为“System.OutOfMemoryException”的异常。 (mscorlib)

------------------------------
程序位置:

   在 System.Text.StringBuilder.ToString()
   在 Microsoft.ProgramSynthesis.Read.FlatFile.Semantics.Semantics.<Csv>g__AddField|9_0(<>c__DisplayClass9_0& )
   在 Microsoft.ProgramSynthesis.Read.FlatFile.Semantics.Semantics.<Csv>d__9.MoveNext()
   在 System.Linq.Enumerable.<SkipIterator>d__31`1.MoveNext()
   在 System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   在 Microsoft.SqlServer.Prose.Import.BcpTextSynthesis.InsertIntoDB(String inputFilePath, String tableName, String schemaName, IReadOnlyList`1 columnInfo, SqlConnection connection, Int32 batchSize, SqlTransaction transaction, IList`1 allFinalTransformations, IList`1 allFinalTransformationColumns, IList`1 allFinalColNames)

...全文
218 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

22,299

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧