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 output to table and excel(csv) #2225

Closed
DanielSQLDBA opened this issue Dec 18, 2019 · 10 comments
Closed

SP_BlitzLock output to table and excel(csv) #2225

DanielSQLDBA opened this issue Dec 18, 2019 · 10 comments

Comments

@DanielSQLDBA
Copy link
Contributor

If you do not wish to run extended events and filter out the data from there, outputting the data from BlitzLock would be nice to have to a table so that you may run it from a agentjob.

Describe the solution you'd like
first iteration I would like to have the abality to dump out to a table with the information sp_blitzLock. Moving forward I would like to be able to give the users ability to filter on specific information.
The data is situated in several temptables the solution will collect these and dump to a table chosen by the user, it should check if the table is valid and existing.

Describe alternatives you've considered
for a customer project we did, we set up ExtendedEvents but we would needed a simplier solution to be able to collect data in a multi tenant environment.

Are you ready to build the code for the feature?
I am able to code the feature I am going to pull down the code and start if the issue gets approved I can fork the project and commit my code to fork.

@BrentOzar
Copy link
Member

Seems like it makes sense! I'd just go for the same parameters as the other procs - @OutputDatabaseName, @OutputSchemaName, and @OutputTableName. (May need a couple of those last one.) Go for it! That sounds good.

@BrentOzar
Copy link
Member

@DanielSQLDBA are you planning on coding this this month? If not, I'll go ahead and close the issue, and you can leave a comment back in here whenever you're ready to start work on it.

@DanielSQLDBA
Copy link
Contributor Author

@BrentOzar got the code working for output to table sorry for not getting back to you should findings also be included if so should they be in a seperate table ?

@BrentOzar
Copy link
Member

No problem! Sure, if you want to include them, they should be in a separate table.

@DanielSQLDBA
Copy link
Contributor Author

hey @BrentOzar have got the code to work findings table is defined and output is there. I have commited the code to my fork next is how to merge with dev branch first stab at github so any help would be appreciated

@BrentOzar
Copy link
Member

@DanielSQLDBA
Copy link
Contributor Author

I got this There isn’t anything to compare.
BrentOzarULTD:dev and DanielSQLDBA:SpBlitzLockDev are entirely different commit histories

Have tried and followed the guide you sent cloned it down to a seperate branch changed the code pushed googled myself crazy do you have any pointers ?

@BrentOzar
Copy link
Member

OK, no problem, I've looked at the code and I can do a pull request from here. Two small changes:

Check the other proc's @output mechanisms - we need columns for ID, ServerName, and CheckDate in each table because a lot of folks schedule this stuff to run every 15 minutes, and then centralize the data in one table.

Then on a related note, it needs to be able to run repeatedly w/o errors. I tried calling it with this twice:

sp_BlitzLock @OutputDatabaseName = 'DBAtools', @OutputSchemaName = 'dbo', @OutputTableName = 'BlitzLock'

The first time it worked, but then the second time I got an error:

Results 1 Jan 20 2020 3:41:22:510PM
Findings Jan 20 2020 3:41:22:523PM
Msg 208, Level 16, State 1, Procedure sp_BlitzLock, Line 1328 [Batch Start Line 0]
Invalid object name 'DeadlockFindings'.

@DanielSQLDBA
Copy link
Contributor Author

@BrentOzar thanks for the feedback and helping a git newbie, fixed the bugs and added servername just pushed up the code to github.

@BrentOzar
Copy link
Member

Awesome, great job! I really appreciate you working with me on this. I've merged the changes into the dev branch, and they'll be in the January release, and I'll credit you in the release notes. Thanks!

@BrentOzar BrentOzar added this to the 2020-01 Release milestone Jan 23, 2020
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