Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Ted_Baker
Partner - Contributor
Partner - Contributor

How to use a stored procedure from SQL Server in Qliksense?

THIS IS THE FIRST PART OF THE CODE, AFTER IT ARE JUST MANY SELECTS AND JOINS:

 

USE [database name]
GO
/****** Object: StoredProcedure [dbo].[IncomeExpenseReport] Script Date: 10/15/2019 10:31:13 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[IncomeExpenseReport]
@startDate DATETIME,
@endDate DATETIME
AS
BEGIN
CREATE TABLE #TmpDocLinesTable(
[TotalValueExpense] DECIMAL(28, 6),
[TotalValueIncome] DECIMAL(28, 6),
[TotalValueIncomeWithVTA] DECIMAL(28, 6),
[CostCenterCode] NVARCHAR(4000) COLLATE SQL_Latin1_General_CP1_CI_AS,
[CostCenterName] NVARCHAR(4000) COLLATE SQL_Latin1_General_CP1_CI_AS,
[CostCenterGroupID] INT,
[CostCenterGroupName] NVARCHAR(4000) COLLATE SQL_Latin1_General_CP1_CI_AS,
[Difference] DECIMAL(28, 6)
)
SET NOCOUNT ON;
DECLARE @partnerEntity INT
DECLARE @agentEntity INT
DECLARE @documentEntity INT
DECLARE @costCenterEntity INT
DECLARE @idLookupValidDocument INT

---

 

-it connects to the database and then it says " error around the word 'ALTER' " - or something similar

-I need to execute stored procedures from an SQL Server Database in QlikSense in order to get some data.

Can you please tell me what the problem is?

Cheers!

0 Replies