首页 文章

SSIS表在控制流中创建但在数据流中导致错误

提问于
浏览
0

我是SSIS的新手,我无法完成这项工作 . 我的控制流程中有两个任务 . 第一个是执行SQL任务,它执行3件事 . 1.检查数据库是否存在 . 2.检查该数据库中是否存在表 . 3.如果表不存在,则创建表 .

然后我有一个数据流任务,将excel电子表格中的数据加载到从执行SQL任务创建的表中 .

如果我单独执行每个任务,一切正常 . 必要时创建表,并加载数据 .

如果我作为一个整体执行包,我会收到一个错误,因为该表不存在 . 如何获取执行SQL任务以创建表然后执行数据流任务以从Excel电子表格加载数据?

我已经包含了一个指向我的控制流的链接,如果有帮助的话 . https://i.stack.imgur.com/Z7dlX.png

这是执行的SQL .

use master
go
[enter image description here][1]if exists (select 1 from sys.sysdatabases where name = '001101_sisdb')

use [001101_sisdb]
go
if not exists (select 1 from sys.tables where name = 'productivity_core_expense_ratio')

    create table productivity_core_expense_ratio (
    fiscal_year int
    ,ipeds_code nvarchar(6)
    ,school_name nvarchar(150)
    ,instruction float
    ,academic_support float
    ,student_services float
    ,public_service float
    ,research float
    ,institutional_support float
    ,num_core_expense float
    ,den_core_expense float
    ,core_expense_ratio float
    )

1 回答

  • 0

    您可以将包属性 Delay Validation 设置为 True ,以告知SSIS在执行时间之前不检查所有对象(数据流等)是否有效 .

相关问题