VERIFIED SOLUTION i
X

Retrieval of data from database using stored procedure in Spectrum Miner

UPDATED: July 26, 2018


Spectrum Miner supports retrieval of data from database using SQL statements and Views but it is not possible to retrieve the data using stored procedure directly. However, stored procedure can be called from view to retrieve the data from database. Follow these steps to create a stored procedure and call it from a view.

1.Create a Stored Procedure.
CREATE PROCEDURE dbo.<StoredProcedure_Name>
AS
SELECT * FROM [<DB_name>].[dbo].[<Table_name>]
GO
2. Create a View in Database and call Stored Procedure created in point #1.
CREATE VIEW [dbo].[<View_Name>]
AS
SELECT * FROM OPENROWSET('SQLNCLI11', 'Server=<machine_name>;Trusted_Connection=yes;','exec [AdventureWorksDW2012].dbo.<StoredProcedure_Name>')
GO
3. Write the SQL code to call the View in a .sql file and open it in Miner window.
select * from dbo.[<View_Name>];

Downloads

  • No Downloads