TableAdapter Configuration Wizard doesn't like temp tables in SP

后端 未结 2 1479
半阙折子戏
半阙折子戏 2021-02-14 01:06

I have a stored procedure that I\'m using in a dataset to generate a report in ReportViewer.

This SP uses temporary tables to store intermediate values, so that these ca

相关标签:
2条回答
  • 2021-02-14 01:28

    There's some known issues with #temp tables and table adapters.

    Some people have got around it by explicitly selecting column names, eg:

    SELECT column1, column2, ... from #temptable rather than SELECT * (if you are doing that)

    You could also try using a table variable rather than a temp table.

    0 讨论(0)
  • 2021-02-14 01:51

    The answer stated here works perfectly, for reasons unknown.

    Just place the below code after the stored procedure after the AS part of the SP.

    IF 1=0 BEGIN
        SET FMTONLY OFF
    END
    
    0 讨论(0)
提交回复
热议问题