Jeffrey Williams

My feedback

  1. 10 votes
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  SQL Server » Suggestions  ·  Flag idea as inappropriate…  ·  Admin →
    Jeffrey Williams supported this idea  · 
  2. 6 votes
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  SQL Server » Suggestions  ·  Flag idea as inappropriate…  ·  Admin →
    Jeffrey Williams supported this idea  · 
  3. 7 votes
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  SQL Server » Bugs  ·  Flag idea as inappropriate…  ·  Admin →
    Jeffrey Williams supported this idea  · 
    An error occurred while saving the comment
    Jeffrey Williams commented  · 

    I ran into this same issue against a system running SQL Server 2016 with many sessions and connections. After further review of the code executing - I have found that the problem is caused by the use of ROW_NUMBER in the outer join to the DMV sys.dm_os_waiting_tasks.

    If you modify that portion of the code to use OUTER APPLY and TOP 1 - for example:

    Outer Apply (Select Top 1
    *
    From sys.dm_os_waiting_tasks wt
    Where wt.waiting_task_address = t.task_address
    Order By
    wt.wait_duration_ms desc
    ) w

    Using the above - the query will execute in less than a second on the problematic system.

  4. 174 votes
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    8 comments  ·  SQL Server » Suggestions  ·  Flag idea as inappropriate…  ·  Admin →

    Upvotes: 278

    <=-=Feb 1 2008 7:18PM=-=>

    Thanks for the valuable suggestion.

    This seems more like adding the sequence support which we’re seriously considering for the next major release.

    Meanwhile, would using identity column help?

    <=-=Feb 2 2008 2:11AM=-=>

    It does not seem that you understood the request. This definitely has nothing to do with
    IDENTITY. I am less versed about sequences, but I don’t think they will cut it either. If you think
    it does, maybe you could provide an example? Take this problem: For the Orders table in
    Northwind, write a query that lists the number of orders for all days in 1997. The result set should
    include all 365 days, and list zero for days without a number.

    This is a typical problem where you need a table of of numbers (or dates). While it’s easy to
    create such a table, I argue in this request that…

    Jeffrey Williams supported this idea  · 

Feedback and Knowledge Base