Include qeury with results set?

  • 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

    aaa bbb ccc ddd

    ... ... . ... . ...

    select * from table2 (Query 2)

    aaa bbb ccc ddd

    aaa bbb ccc ddd

    ... ... . ... . ...

    TIA,

    barkingdog

  • 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

  • Good idea.

    Thanks,

    Barkingdog

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply