How to execute reports which involve a stored procedure calling out to a linked server - tsql

I wrote a stored procedure that calls openquery to a linked server to get data from a remote postgresql server and fill a table with that data. This is working fine. The stored procedure needs 3 parameters.
When I try to call the stored procedure from Report Builder 3.0 gives me error
7350 (cannot get the column OLE DB provider MSDASQL from linked server "name").
I already verify the allow in-process parameter in MSDASQL.
I can't find a solution for this. If I run the stored procedure from Mgmt Studio, it works fine. I'm using SQL Server 2012.
The report only have to show the file data by row. I can run the stored procedure and the report separately and works but I have to do this manually, my requirement needs a report subscription, so have to be automatic.
Any idea how to solve this or a workaround?
PD: sorry for my english, and thank you in advance.

Well I had to make separates works, so create a job that run the store procedure, generate the info on a table, and then run report reading the info from the table. This works.
Thank you all.

Related

Can we see IBM DB2 stored procedure content in AQT(Advanced Query Tool)?

I am not an expert in IBM Host tools as I am from development distributed side. Is there anyway that we can see the source code of IBM DB2 stored procedure in AQT tool. I know we can use any emulator tools like Attachmate Extra! X-treme, but the process seems very tough for me. To view a single stored procedure content, I had to type many number of commands. So I just thought it would be great if we have an option to view the same in a simple way, like we have sp_helptext in SQL SSMS (SQL Server Management Studio).
Update:
When I go to the Database Objects -> Procedures, all the schema's for different stored procedures are loading. And when I click on each schema, the stored procedures associated with that are loading, where I am able to see the procedure parameters, run procedure, create procedure etc. But I couldn't find any option to see the actual SQL query of the procedure.
When I click right click on procedure name and select View, I am getting options as,
Procedure Details
Procedure Params
User Access List
Package Access List
I am not seeing any option like Procedure Text. The language in Procedure Detail shows as COBOL and User Access List shows Execute G. Sorry that I can't provide any screenshots here, as it is the client machine I am working on.
Are you using the right tool for the job?
The AQT tool appears to be for procedures that are written in SQL, but your procedures appear to be COBOL stored-procedures. Source code for COBOL stored-procedures is normally managed outside of the RDBMS.
Talk with your DBA team or COBOL developers to find out which toolset at your site gives access to the source code for the COBOL stored procedures.

Calling Stored Procedures from Microstrategy

We have a stored procedure that takes in a set of parameters (from dimension tables) and then outputs a set of rows from which a report has to be created.
Till now this is done in a .NET app using an ORM, but is it possible to integrate it with MicroStrategy?. How do I pass the selected params (from a report prompt) to a Stored Procedure on the database and then map the results back to the report?
In the past I did a Free Form SQL (FFSQL) report in MicroStrategy on top of a PL/SQL function which returned a 'table' (Of course that was an Oracle database, more info about returning a table with a function here).
So what you are looking for is something doable.
You can use the prompts in FFSQL report as parameters for your function
Then you have to map the columns of the returned table as attributes and metrics returned by the FFSQL report
This is something I did in a very old MicroStrategy implementation to provide writeback functionality: the users were allowed to update some values in some tables and the function returned a Success or Error message.
As you can imagine this was not a standard Data Warehouse solution, it was more an hoc solution for an operational database.
My suggestion is to avoid similar solution if not necessary and prepare in advance the tables/rows that you need. Of course in your case you have already the procedure ready so you have just to figure out how to combine it with MicroStrategy.
Some useful readings:
TN37783: Instructions to use stored procedures within Freeform SQL reports in MicroStrategy 9.x against different databases
Using Prompts in Freeform SQL Reports

Stored Procedure Fails on Converting Datetime Only When Ran From SQL Agent Job

Problem
Executed as user: CORP\SVC-UK-SVCEMI. Conversion failed when converting date and/or time from character string. [SQLSTATE 22007] (Error 241). The step failed.
The problem I am facing is that I have created a Stored Procedure which, when executing in a SSMS Query window, runs fine - but fails when ran ran from a SQL Agent job.
Why I'm Stuck
As the job is running the exact same procedure, on the same database and data, I am severely confused on why this wouldn't work.
My Thoughts
Logically, I would put it down to the user account (As this is the only possible different I had identified), thinking maybe the SQL Agent service account somehow has a difference date format setting when myself. However, I am under the impression that these are set at server level (Which we have recently changed to GB-English) - rather than account level.
As I can't manage to replicate this issue in the query window, it has become extremely difficult to debug which row is causing the issues
Running from SSMS Query Window
SQL Agent Jobstop Configuration
Error Generated When Running Job
As I believe this to be a SQL Agent configuration issue, I haven't added any code from the SQL Procedure. I can do this on request, but it is very long (Think I take readability over shortness - and possibly performance- when it comes to writing SQL)
Any ideas on what could be causing this problem would be greatly appreciated.
Many thanks.
Ths stored proc in the Job is probably running under a different user account than the one you use when launching it from SSIS.
and, probably, this user account has different settings
try "EXECUTE AS user=xxxx" for your stored proc and use your own user account, then see what happens...
see: EXECUTE AS

How to view explain plan for a DB2 Stored Procedure in IBM DataStudio?

How to view the access plan for the entire SP along with the cost in IBM DataStudio, I am able to view it for a single query but when I do the same for a Stored Procedure it throws an error.
Found the answer, using db2expln executable from the command window, I was able to generate the execution plan for the stored procedures.

Ignore failed data source in SSRS 2008

I have a report that runs one query in 9 different Oracle databases. If one of these databases is down, the whole report bombs. Is there any way to set it so it ignores this failure and proceeds with the rest of the report?
I'm not sure if there is a way to do what you're wanting within RS, but here's my idea:
If you can call from a SQL database -
Set up linked servers on a sql server.
Wrap the call in a stored procedure and return an alternate data set if the call fails to the linked server.
You could probably do something similar if there is an oracle server you can use.