dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

Get-DbaProcess: Fix for empty most_recent_sql_handle #9375

Closed andreasjordan closed 3 weeks ago

andreasjordan commented 1 month ago

Type of Change

Purpose

Sometimes, when there is no last sql handle, most_recent_sql_handle is 0x0. Then the CROSS APPLY filters out that process.

Approach

We now use OUTER APPLY to get the row.

potatoqualitee commented 3 weeks ago

Thank you! This works all the way back to 2005 as well 👍🏼