Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sp_HumanEventsBlockViewer: duplicate column name breaks powershell automation #505

Open
DForck42 opened this issue Dec 9, 2024 · 2 comments

Comments

@DForck42
Copy link

DForck42 commented Dec 9, 2024

Version of the script
3.9, 20240915

What is the current behavior?
the first result set has the duplicate column name blocked_process_report, causing powershell to error out

If the current behavior is a bug, please provide the steps to reproduce.
run this powershell:

   $BlockQuery = "
    DECLARE @startdate datetime = getdate()-1

    EXEC dbo.sp_HumanEventsBlockViewer @session_name = N'Blocked_Process_Report',
                                    @start_date = @startdate,
                                    @end_date = NULL;"

    $BlockQuery

    $Results = Invoke-SQLCmd -ServerInstance servername -Database master -Query $BlockQuery -as Dataset

What is the expected behavior?
being able to run powershell and get the results as a data set without the error

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
sql server 2019, windows server 2019. my team thinks this has been broken since about April 2024 for us

IMPORTANT: If you're going to contribute code, please read the contributing guide first.
https://github.com/erikdarlingdata/DarlingData/blob/main/CONTRIBUTING.md

@erikdarlingdata
Copy link
Owner

@DForck42 I don't use PowerShell at all, so this issue would be on you to fix.

@DForck42
Copy link
Author

DForck42 commented Dec 9, 2024

ok i did the thing, hopefully correct this second time around - #509

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants