all groups > sql server reporting services > march 2005 >
You're in the

sql server reporting services

group:

Database update from report?


Database update from report? CC
3/11/2005 1:01:04 PM
sql server reporting services:
eCan you call a stored procedure from a report that will update the database?
I want to update som tables when a report has finished generating.

I tried to call the update stored procedure from my code (Cold Fusion), but
the update code was executing before the report call, so the report queries
were not getting any data since the data had already been updated.

Re: Database update from report? Bruce L-C [MVP]
3/11/2005 3:33:36 PM
This might work for you.

Use the generic query designer. Put in the statements like this:
select * from sometable
exec someprocedure

I suggest first hard coding any parameters for the stored procedure and then
put them in and map them to a report parameter.

--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Database update from report? Lukasz Pawlowski [MSFT]
3/14/2005 12:18:22 AM
Though you can call statements that up date your database, there are several
problems with this:
1) this can be a security issue - if you store credentials someone with
lesser credentials can now update your database
2) RS does not guarantee that the query will be executed at any specific
time. As such, it might be that the other quireies have not yet have run
when you expected them to have been already exedcuted.

-Lukasz


--
This posting is provided "AS IS" with no warranties, and confers no rights.



[quoted text, click to view]

Re: Database update from report? mshumaker
3/16/2005 2:37:05 PM
Is there a better way to do this? Perhaps a custom data processing extension?

I also need to update a database table with values "created" by the report.
Essentially I want to store off values from detailed/sub reports to be used
by a summary report.

Thanks,
Matt

[quoted text, click to view]
Re: Database update from report? Ruud
6/11/2005 10:24:01 PM
I just finished off a set of reports with a update/insert stored procedure.
so maybe this might work for you too.

I made a report with the update/insert stored procedure that confirms the
update/insert with the used parameters.
That specific report is called from the "select" report as a subreport.

Depending how your security is set, the function "created by" might be
handled by a statement in the stored procedure: "get user".

OR using the policies table from reportserver database.
(Didn't figure out that one out yet)


[quoted text, click to view]
AddThis Social Bookmark Button