How can we improve Microsoft Azure SQL Data Warehouse ?

@@ROWCOUNT Support

Please enable @@ROWCOUNT?

Furthermore considering that we cannot switch NOCOUNT on, then why should it be such a secret/coded mission to track the number of rows affected by the most recent snippet of code? The proposed work-around seems onerous and doesn't always work (for dynamic SQL) yet my query window still knows and always-prints the fact that it returned 15 rows to me, for example, so why can we not leverage this elementary information inside the selfsame query (?):

SELECT SUM(row_count) AS row_count
FROM sys.dm_pdw_sql_requests
WHERE row_count <> -1
AND request_id IN
( SELECT TOP 1 request_id
FROM sys.dm_pdw_exec_requests
WHERE session_id = SESSION_ID()
AND resource_class IS NOT NULL
ORDER BY end_time DESC
)

77 votes
Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)

We’ll send you updates on this idea

Luke shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

2 comments

Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)
Submitting...
  • Mike LaRue commented  ·   ·  Flag as inappropriate

    I've encountered the same situation described earlier where fast overwriting of information in the sys.dm_pdw_request_steps DMV causes the row_count to age off before it can be read by the workaround.

    If it is not possible to implement the @@ROWCOUNT system function in Azure data warehouse in the near term, could the capacity of the sys.dm_pdw_request_steps and sys.dm_pdw_exec_requests be increased to double the current limits in the interim?

  • Simon Whiteley commented  ·   ·  Flag as inappropriate

    We're currently hitting an issue with this one - we're using the workaround query you've got above you rowcount logging, but we're running lots of procedures in parallel which each kick off a stats rebuild. The stats rebuild FLOODS the sql_requests table and forces to be aged out before we've had a chance to get their rowcount.

    A rowcount solution that is susceptible to a race condition isn't a good solution especially, as mentioned, the query window displays the rows updated so the metadata must be available somewhere!

    Hoping this gets sorted soon...

    Simon

Feedback and Knowledge Base