Page 1 of 1

display result of select script with temp table

PostPosted: Wed Jun 19, 2013 2:17 pm
by igorewka
Hello,
e.g. select script:
select *
into #t1
from country t2
where t2.country_code = 'AD'

select *
from #t1

DROP TABLE #t1 --with or without this line

This script results in:
updated rows
------------------
1

Expected result:
Other tools, e.g. MS SQL Server Management Studio, Toad for SQL Server display result set of the last select

Do you think it's possible to implement this? I'm tired of using MS SQL Server Management Studio for such cases.

Re: display result of select script with temp table

PostPosted: Thu Jun 20, 2013 8:02 am
by Serge
Hi,

How do you execute these 3 queries? As a single statement or as a script?
You can execute it as script with separate results tab for each query (ctrl+alt+x) but in fact it is not very convenient.

I can add config option which will tell DBeaver to omit non-resultset results (like updated rows count) for scripts. But may be there could be a btter solution..

Re: display result of select script with temp table

PostPosted: Thu Jun 20, 2013 10:18 am
by igorewka
I execute all statements together as a script with alt+x.

Just in case, another more clean example, it's impossible to execute parts separately with ctrl+alt+x :
declare @t1 table(country_code varchar(2))
insert into @t1(country_code) select t2.country_code from country t2 where t2.country_code = 'AD'
select * from @t1

Current result:
updated rows
------------------
1

Expected result:
country_code
-----------------
AD