以 SQLServer 2019 为目标时,Visual Studio 2019 SSIS 项目出现 80040153 错误

Get 80040153 error with Visual Studio 2019 SSIS project when targeting SQLServer 2019

Visual Studio社区 2019 16.8.1,SQL服务器 2019

我在 VS 2019 中创建了一个新的 SSIS 项目。然后我创建了一个 Connection Manager 并成功测试了与数据库的连接。

当使用简单的 query 执行 SQL Task 时,我得到这个错误:

[Execute SQL Task] Error: Executing the query "" failed with the following error: "Retrieving the COM class factory for component with CLSID {0EB5013B-538B-456B-AF1B-96DD1004026B} failed due to the following error: 80040153 Invalid value for registry (Exception from HRESULT: 0x80040153 (REGDB_E_INVALIDVALUE)).". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

如果我打开一个使用 Visual Studio 2017 创建的 SSIS 项目并设置相同的 Connection ManagerExecute SQL Taskquery 它会成功运行。

由于 query 使用 VS 2017 SSIS 项目,我相信系统配置正确。

我在 Visual Studio 中卸载并重新安装了 SQL Server Integration Serives Projects 扩展,然后删除并重新创建了 SSIS 项目。

.dtproj 文件中有一个条目。

  <Configurations>
    <Configuration>
      <Name>Development</Name>
      <Options>
        <OutputPath>bin</OutputPath>
        <ConnectionMappings />
        <ConnectionProviderMappings />
        <ConnectionSecurityMappings />
        <DatabaseStorageLocations />
        <TargetServerVersion>SQLServer2017</TargetServerVersion>
        <AzureMode>false</AzureMode>
        <LinkedAzureTenantId />
        <LinkedAzureAccountId />
        <LinkedAzureSSISIR />
        <LinkedAzureStorage />
        <RemoteExecutionFolder />
        <ParameterConfigurationValues>
          <ConfigurationSetting>
            <Id>LastModifiedTime</Id>
            <Name>LastModifiedTime</Name>
            <Value xsi:type="xsd:dateTime">2019-07-04T21:20:58.4351661Z</Value>
          </ConfigurationSetting>
        </ParameterConfigurationValues>
      </Options>
    </Configuration>
  </Configurations>

在 VS 2017 SSIS 项目中,它被设置为 SQLServer2017。在 VS 2019 SSIS 项目中 SQLServer2019。如果我在 VS 2019 SSIS 项目中定位 2017,错误就会清除。

从 SSMS 我 运行 查询 SELECT @@VERSION 并报告:

Microsoft SQL Server 2019 (RTM-GDR) (KB4517790) - 15.0.2070.41 (X64) Oct 28 2019 19:56:59 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 18363: ) (Hypervisor)

为什么定位 SQLServer2019 抛出错误但定位 SQLServer2017 运行成功?

在命令提示符下,您需要运行 regsvr32 SQLTaskConnections.dll 来注册 DLL。这将允许在 .dtproj 文件中定位 SQLServer2019