1

I have a stored procedure in SQL Server which runs correctly, I need to use the table returned by it as my data for my report in .rdlc format.

EXEC my_stored_procedure @name, @begindate, @enddate

The stored procedure starts like:

BEGIN
    DECLARE ...some variables..

    IF OBJECT_ID('tempdb..#proptbl') IS NOT NULL
        DROP TABLE #proptbl

END

I am trying to add a dataset using an .xsd to my Report Application in SQL Server Data Tools 2015.

I've created the .rdlc and need to add an .xsd and connect to rdlc.

I added .xsd to the project, added a "table adapter" in it, connected to my database, selected "Use Existing Stored Procedure" as command type, set my procedure in the "select" segment (parameters are not coming, see picture below), check "Fill a datatable" and "Return a datatable". At this point when I click next button, I am get this error:

enter image description here

So there is no data returned. Stacked here, any help would be appreciated. Thanks.

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Eray Balkanli
  • 7,752
  • 11
  • 48
  • 82

1 Answers1

0

Found my answer here: TableAdapter Configuration Wizard doesn't like temp tables in SP

Adding this after "AS" keyword at the beginning of the SP helped:

IF 1=0 BEGIN
    SET FMTONLY OFF
END
Eray Balkanli
  • 7,752
  • 11
  • 48
  • 82