Barkingdog
SSCoach
Points: 18670
More actions
March 15, 2010 at 3:55 pm
#219878
Is there a way to get Query Editor to return the query before the result set in the Results pane? For example,
Results window
--------
select * from table1 (Query 1)
aaa bbb ccc ddd
... ... . ... . ...
select * from table2 (Query 2)
TIA,
barkingdog
JeffRush
SSC Eights!
Points: 855
March 15, 2010 at 4:21 pm
#1134153
Might try something like:
DECLARE @query1 AS NVARCHAR(1000)
SET @query1= 'SELECT * FROM table1'
DECLARE @query2 AS NVARCHAR(1000)
SET @query2= 'SELECT * FROM table2'
SELECT @query1
EXEC sp_executesql @query1
SELECT @query2
EXEC sp_executesql @query2
March 15, 2010 at 5:00 pm
#1134163
Good idea.
Thanks,
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply