• monilps (11/18/2014)


    Hi,

    Can anyone please help me how to write query with PRINT Statement for below query.

    WITH CTE1 AS (SELECT * FROM table1),

    CTE2 AS (SELECT * FROM table2),

    CTE3 AS (SELECT * FROM table3)

    In between to use PRINT statement seeing where my current query is.

    So once we process "SEELCT * FROM table1" and gets completed I want to print as "Table table1 completed".

    Thanks in advance.

    AFAIK, these queries would not necessarily be processed sequentially when executed like this, so there's no way of sending any sort of 'completed' message unless you separate them.

    The construction builds three in-memory subqueries whose results will be consumed by the statements appearing immediately after them.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.