简体   繁体   English

每次运行报告时如何执行存储过程?

[英]How do I execute a stored procedure every time a report is run?

I have a stored proc that basically is used for logging reports that were executed with their parameters. 我有一个存储的proc,基本上用于记录使用其参数执行的报告。 I'd like to run this stored proc on every execution of the report? 我想在每次执行报告时运行此存储的proc吗?

Do I do this through the report code window? 是否通过报告代码窗口执行此操作?

Have you looked at the information held in the Reporting Services database already? 您是否已经查看了Reporting Services数据库中保存的信息? I think report executions and parameters should be recorded though maybe not in a friendly format. 我认为应该记录报告执行和参数,尽管可能不是友好格式。

The following links are for SQL2005 I guess that it ought to be possible to get this info out of SQL2008 as well. 以下链接是针对SQL2005的,我想应该也可以从SQL2008中获取此信息。

SSIS approach to data warehouse from ExecutionLog table to more usable format. SSIS将数据仓库从ExecutionLog表转换为更可用的格式。

http://msdn.microsoft.com/en-us/library/aa964131%28SQL.90%29.aspx http://msdn.microsoft.com/zh-CN/library/aa964131%28SQL.90%29.aspx

TSQL Approach TSQL方法

http://www.sqlservercentral.com/scripts/RSExecutionLog/66858/ http://www.sqlservercentral.com/scripts/RSExecutionLog/66858/

If the report retrieves the data by already calling a stored procedure, what you should do is have this new stored procedure that you require inside the other one. 如果报表已通过调用存储过程来检索数据,那么您应该做的就是在另一个存储过程中拥有这个新的存储过程。

Otherwise, yes, on the report code window is the best 2nd choice, IMO. 否则,是的,在报告代码窗口中,最好的选择是IMO。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM