Monday 1 December 2014

Using Stored Procedure in Power Pivot

To get data from sql server using stored procedures in power pivot, follow below points:
  1. SET ANSI_WARNINGS OFF (there should not be any warnings returned by the query)
  2. SET NOCOUNT ON (query should not return more than 1 count. In the below example execute SPand insert returns count, then again on select another count is returned. So totally 2, and it should not be the case).
EX: 
SET ANSI_WARNINGS OFF
SET NOCOUNT ON

CREATE TABLE #tmp
(
EmployeeID INT
, Employee VARCHAR(225)
)

INSERT INTO #tmp EXEC usp_Name
SELECT * FROM #tmp

DROP TABLE #tmp


2 comments:

  1. Thanks for sharing such a wonderful Post with us. I learnt alot from your post. I am appreciating from you to you will share more
    information about it. Please keep sharing. Thanks Alot
    Toshiba laptop Service Center in Ameerpet, Hyderabad.
    Best Laptop Service Center in Ameerpet, Hyderabad.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete