Skip to content
Advertisement

How do I get result from SELECT clause after CREATE and INSERT clause?

I have a query that I intend to put into a stored procedure for ultimate use in Tableau. I am getting affected row(s) instead of the grid result.

The query is as follows:

IF EXISTS #A DUMP #A
CREATE #A
INSERT INTO #A FROM A
SELECT * from #A

Currently I get output of 1000 row(s) affected. But I need the output of the SELECT clause instead.

Advertisement

Answer

include

SET NOCOUNT ON

before entire script

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement