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_Blitz - Add Check for all FRK SP version date is the same #1994

Closed
jeffchulg opened this issue Mar 6, 2019 · 6 comments

Comments

Projects
None yet
2 participants
@jeffchulg
Copy link
Contributor

commented Mar 6, 2019

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

As I added the capability to run all the SP in VersionCheckMode, the next step could be to run a check for "schema consistency" (and I think sp_Blitzis the right candidate to do it).

Describe the solution you'd like
A clear and concise description of what you want to happen.

In sp_BlitzFirst, create a temporary table which contains the name of each SP, except sp_Blitz.

Run a loop that will:
0) Create a variable Highest

  1. Check the procedure exists
    1a=> if not exists ==> continue
    1b => if exists:
    run the stored procedure in VersionCheckMode (using dynamic SQL) and maybe between TRY...CATCH.
    if the version for at least one SP is older than the one from sp_Blitz, then there is an inconsistent installation
    If the version for at least one SP is higher than the one from sp_Blitz, then there is an insconsistent installation

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Create a new dedicated stored procedure

Are you ready to build the code for the feature?
As much as we'd love to build everything that everyone wants for free, we need your help. Open source is built with your help and code. Are you ready to commit time to this project? Have you got existing code you can help contribute to solve the problem?

Why not... it does not seem to be difficult or time-consuming to implement...

@BrentOzar

This comment has been minimized.

Copy link
Member

commented Mar 6, 2019

I love it! That's a great idea. Things to think about:

  • One or more of the scripts may not exist (and that's OK, shouldn't flag a warning that there's an inconsistent installation)
  • The scripts may be installed in the master database, but you may be in a different database context
  • The scripts may be installed in a user database, and you may be in the same database context (example: users install it in a "DBA" database and run them from that same database, without db/schema prefixes)
  • The scripts may be installed in a user database, and you may be in a DIFFERENT database context (example: installed in "DBA", but run from tempdb with fully prefixed names, like "EXEC DBA.dbo.sp_Blitz")
@jeffchulg

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2019

HI Brent,

the use of DB_NAME() to build the dynamic SQL inside sp_Blitz should solve the "the scripts may be installed" sentences, shouldn't it?

@BrentOzar

This comment has been minimized.

Copy link
Member

commented Mar 6, 2019

Yes, as long as you use that to build fully qualified calls to the procs, that will work, I bet.

@jeffchulg

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2019

Hi Brent,

could you please review the code attached... I don't want to insert it directly to sp_Blitz before it's ok for you...
VersionCheck.sql.txt

@BrentOzar

This comment has been minimized.

Copy link
Member

commented Mar 7, 2019

@BrentOzar

This comment has been minimized.

Copy link
Member

commented Apr 22, 2019

Awesome, thanks sir! I'm going to make a few tweaks, but great job. I've merged it, and it'll be in this month's release, along with credits for you in the blog post. Thanks!

BrentOzar added a commit that referenced this issue Apr 22, 2019

#1994 sp_Blitz version checking
Changed wording from "consistency check" to "version check," updated check IDs, removed mandatory scripts. Closes #1994.

BrentOzar added a commit that referenced this issue Apr 22, 2019

#1994 sp_Blitz version checking (#2028)
Changed wording from "consistency check" to "version check," updated check IDs, removed mandatory scripts. Closes #1994.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.