SSIS 温度 Table 错误

SSIS Temp Table error

我让 SP 包含临时文件 table 并在输出中生成 4 列 作为 id、名称、原始和更改 输出需要保存在平面文件中。

任何人都可以建议如何执行 SQL 任务。

我尝试使用数据访问模式的 oledb 作为 SQL command.but 出现错误 0x80040E14.

任何人都可以提出一些建议。 谢谢

借用here的回答,可以使用WITH RESULT SETS提前告诉SSIS引擎存储过程返回什么数据。

With this procedure:

CREATE PROCEDURE dbo.UseTempTable
AS
BEGIN
    SET NOCOUNT ON;

    CREATE TABLE #MyTable(WhoCares INT NOT NULL IDENTITY(1,1) PRIMARY KEY, Whatever VARCHAR(99));

    INSERT INTO #MyTable(Whatever) VALUES('Minger');
    INSERT INTO #MyTable(Whatever) VALUES('Bonjour');

    SELECT ColInt = WhoCares
        ,  ColVarChar = Whatever
        FROM #MyTable


END;

I would get an error in SSIS 2012 if I tried to use it as a datasource in a dataflow.

Before 2012, there were various tricks to show a "pretend" recordset such as SET FMTONLY ON... SET FMTONLY OFF but they don't work in 2012.

From Phil's article, we just need to specify our Data Flow datasource as

EXEC('EXEC dbo.UseTempTable') 
    WITH RESULT SETS
    ( ( ColInt INT NOT NULL, ColVarChar VARCHAR(99)) )

更多信息:link