Closed pelya1986 closed 2 years ago
@pelya1986 thanks for the pull request, but cross-database queries like this don't work in Azure SQL DB. One of the goals of sp_WhoIsActive
is to work there.
If I try to execute this code there, I get this error:
Msg 40515, Level 15, State 1, Line 16 Reference to database and/or server name in ‘msdb.dbo.sysjobs’ is not supported in this version of SQL Server.
@pelya1986 If you'd like to submit a PR that's friendly to Azure SQL DB, we're more than willing to accept it. It'd just have to be some dynamic SQL to catch that up front so the proc doesn't error out.
I understood. I write because in last versions don't work correctly @get_additional_info = 1 When I execute in result additional_info without parametr job_name
don't work in v12.00-RC3
Ok, I just tested it on the following SQL versions, and the [job_name] appears in addtional_info. What version of SQL Server are you running?
sp_whoisactive version v12.00-RC3 Microsoft SQL Server 2019 (RTM-CU8-GDR) (KB4583459)
I double-checked everything works
sorry
@pelya1986 No worries, I had to install 2019 on my new notebook sooner or later anyways, investigating this possible bug just made that transition occur more rapidly. Which is a good thing.
Add JobName if program_name like 'SQLAgent%'