在 SSIS 中使用临时表 [英] Using Temp tables in SSIS

查看:35
本文介绍了在 SSIS 中使用临时表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SQL Server 的存储过程中使用临时表.我正在尝试在 OLE DB 源代码编辑器中使用该 SP.

I am using a Temporary table in Stored Procedure in SQL Server. I am trying to use that SP in OLE DB Source Editor.

我可以在构建查询"按钮附带的查询构建器"中看到返回的数据输出.但是当我单击列"选项卡时,出现以下错误.

I can see the data output returned in the Query Builder that comes with Build Query button. But when I Click the Columns tab, I am getting the below error.

数据流任务中的错误 [OLE DB 源 [1]]:SSIS 错误代码DTS_E_OLEDB 错误.发生 OLE DB 错误.错误代码:0x80004005.OLE DB 记录可用.来源:微软 SQL服务器本地客户端 10.0" Hresult: 0x80004005 描述: "无效对象名称'##Payment'.".

- TITLE: Microsoft Visual Studio

Error at Data Flow Task [OLE DB Source [1]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Invalid object name '##Payment'.".

数据流任务中的错误 [OLE DB 源 [1]]:无法检索列来自数据源的信息.确保您的目标表在数据库可用.

Error at Data Flow Task [OLE DB Source [1]]: Unable to retrieve column information from the data source. Make sure your target table in the database is available.

这是否意味着我不能在 SP 中使用临时表,如果我希望它被 SSIS 使用

Does that mean I cant use temp tables in SP, if I want it to be consumed by SSIS

推荐答案

我用过

设置 FMTONLY 关闭在程序开始时,它会告诉客户端不要处理行当它没有被执行时因为在解析 SP 时没有临时表,因此在解析时没有可用的列.

SET FMTONLY OFF at the start of procedure, which will tell not to process rows to the client when it is not being executed as there is no temp table while parsing the SP, hence no column available while parsing.

终于让我工作了:)

这篇关于在 SSIS 中使用临时表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆