问题描述
如何让 SSIS 数据流创建一个不存在的表?每次我尝试运行包时,它都会给我一个错误,说目标表不存在.
How can I have an SSIS data flow create a table that doesn't exist? Every time I try to run the package, it gives me an error saying that the destination table doesn't exist.
推荐答案
由于您希望您的包创建一个表然后填充它,您可以使用 Execute SQL
任务创建一个.只需为它提供创建表格的脚本即可.
Since you want your package to create a table and then populate it, you can create one using the Execute SQL
task. Just give it the script to create your table.
如果您没有使用 Execute SQL
或 Script
任务的选项,那么您可以使用 Script
组件,但由于它对每一行执行,您必须发挥创意才能让它只执行一次.
If you do not have the option of using an Execute SQL
or Script
task, then you can use a Script
Component, but since it executes for every row, you'll have to get creative to have it execute only once.
此外,当您运行此程序包时,SSIS 会记录验证期间未找到的表.
Also, when you run this package, SSIS going to crib about the table not being found during Validation.
为了解决这个问题,在包属性中,在填充表的数据流中,将 Delay Validation
属性设置为 True
To counter that, in the package properties, in data-flow that populates the table, set Delay Validation
property to True
这篇关于在 SSIS 数据流中动态创建表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!