【发布时间】:2014-03-17 16:46:30
【问题描述】:
我对 Microsoft SQL Server 非常陌生,并且正在使用 2012 Management Studio。当我尝试使用向导将查询结果导出到 Excel 文件时,出现上述错误。我在其他地方看到过针对此错误发布的解决方案,但不知道如何实施推荐的解决方案。有人可以逐步指导我完成这些解决方案之一吗?
我认为我的问题是 SQL Server 导入和导出向导无法识别 Varchar 和 NVarchar,我认为这是我收到错误的列的数据类型。
Source Type 200 in SQL Server Import and Export Wizard?
查询:
SELECT licenseEntitlement.entID, licenseEntitlement.entStartDate, entEndDate, quote.quoteId, quote.accountId, quote.clientId, quote.clientName, quote.contactName,
quote.contactEmail, quote.extReference, quote.purchaseOrderNumber, quote.linkedTicket
FROM licenseEntitlement INNER JOIN
quote ON quote.quoteId = SUBSTRING(licenseEntitlement.entComments, 12, PATINDEX('% Created%', licenseEntitlement.entComments) - 12)
inner join sophos521.dbo.computersanddeletedcomputers on computersanddeletedcomputers.name = entid and IsNumeric(computersanddeletedcomputers.name) = 1
WHERE (licenseEntitlement.entType = 'AVS') AND (licenseEntitlement.entComments LIKE 'OV Order + %') and entenddate < '4/1/2014'
ORDER BY licenseEntitlement.entEndDate
错误:
TITLE: SQL Server Import and Export Wizard
------------------------------
Column information for the source and the destination data could not be retrieved, or the data types of source columns were not mapped correctly to those available on the destination provider.
[Query] -> `Query`:
- Column "accountId": Source data type "200" was not found in the data type mapping file.
- Column "clientId": Source data type "200" was not found in the data type mapping file.
- Column "clientName": Source data type "200" was not found in the data type mapping file.
- Column "contactName": Source data type "200" was not found in the data type mapping file.
- Column "contactEmail": Source data type "200" was not found in the data type mapping file.
- Column "extReference": Source data type "200" was not found in the data type mapping file.
- Column "purchaseOrderNumber": Source data type "200" was not found in the data type mapping file.
- Column "linkedTicket": Source data type "200" was not found in the data type mapping file.
如果需要更多详细信息,请告诉我
【问题讨论】:
-
我认为你需要显示你运行的查询,描述返回的列的数据类型,描述你导出结果的步骤和你得到的错误。这里没有人会做你想做的事 - 如果我不能在 5 分钟内回答,除非我个人感兴趣,否则我可能不会 - 我们没有人为此得到报酬,你的问题需要付出大量的努力没有明确的限制。
-
已添加 SSIS 标记:Mgmt Studio 中的导出数据向导正在运行
SSIS(SQL Server Integration Studio),因此这是一个 SSIS 错误。不过,西蒙是对的:我们需要更多细节。我建议先向我们提供错误消息的完整且准确的文本。而且,由于data type是列的属性,请告诉我们您可以对这些列做些什么。 -
感谢您的回复,我添加了详细信息。我认为可能有一个简单的解决方法,可以用简单的术语解释,由于我在这里的知识有限,技术性不太强。如果不是这种情况,请告诉我,我可以删除问题。再次感谢。
-
首先,Microsoft 承认这是导入/导出向导中的一个已知错误。其次,所有链接中推荐的解决方法是将您的查询转换为视图,然后从 that 导出。为什么不能实现呢?
标签: sql-server excel ssis sql-server-2012 ssms