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_BlitzLock.sql: Missing BEGIN around client output code #3276

Closed
JonasEckerman opened this issue May 12, 2023 · 5 comments · Fixed by #3280
Closed

sp_BlitzLock.sql: Missing BEGIN around client output code #3276

JonasEckerman opened this issue May 12, 2023 · 5 comments · Fixed by #3280

Comments

@JonasEckerman
Copy link

Version of the script

  • @Version = '8.14'
  • @VersionDate = '20230420'

Cause of the error

There is a missing BEGIN for the code block that send output to the client. The result is that output is always sent to the client, regardless of what @OutputDatabaseCheck is set to.

  • The BEGIN should be after the line ELSE /*Output to database is not set output to client app*/.
  • And that means there needs to be another END after the line END; /*done with output to client app.*/

What is the current behavior?

When you run dbo.sp_BlitzLock with oputput to table, the procedure will send outpout to the client as well as tables.

If the current behavior is a bug, please provide the steps to reproduce.

EXEC dbo.sp_BlitzLock
@OutputDatabaseName = 'test0', -- Replace this with a suitable database name
@OutputSchemaName = 'dbo',
@OutputTableName = 'BlitzLock_Output';

What is the expected behavior?

That output is sent only to tables.

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 on Windows
  • It did work correctly on older versions, but I don't know exactly when i broke. Probably in November or December 2022.
@erikdarlingdata
Copy link
Contributor

I've assigned this to you, since you know exactly which changes to make.

@JonasEckerman
Copy link
Author

I've assigned this to you, since you know exactly which changes to make.

I'll try to steal some time to fetch the code and create a pull request the next few days.
(I don't collaborate with git (or github) regularly, so I might need some time to figure that stuff out.)

@erikdarlingdata
Copy link
Contributor

@JonasEckerman if you can't figure it out, you can post the code with comments to highlight your changes somewhere (like a GitHub gist or similar) and I can incorporate them. I have some changes in flight as well. Thanks!

erikdarlingdata added a commit to erikdarlingdata/SQL-Server-First-Responder-Kit that referenced this issue May 17, 2023
@erikdarlingdata
Copy link
Contributor

@JonasEckerman I took care of this one.

@BrentOzar BrentOzar added this to the 2023-06 Release milestone Jun 13, 2023
@JonasEckerman
Copy link
Author

@JonasEckerman I took care of this one.

Thank you!

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

Successfully merging a pull request may close this issue.

3 participants