-
Notifications
You must be signed in to change notification settings - Fork 741
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
Generating an Azure SQL Notebook for Best Practice Checks from the same script for the stored procedure #178
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…is brain has stopped working
…red if ADS was being a snowflake again
SQLDBAWithABeard
changed the title
Generating an Azure SQL Notebook for Best Practice Checks from teh
Generating an Azure SQL Notebook for Best Practice Checks from the same script for the stored procedure
Dec 4, 2019
THANK YOU ROB! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have tried to do something that may or may not be the best way to do this. As such I am happy if this PR gets refused or if others wish to work on it that would be excellent as well.
I have altered the stored procedure in such a way that whilst it is still doing exactly the same (in my testing) the PowerShell command will use the same file to create a SQL Notebook for the code
This has required using tables in tempdb and ensuring that the different checks are split by 128 '-'
I did it this way so that there is only one piece of code to be maintained. I'm not sure if it is the best way forward, thats for others to decide.
The sql files creates the stored procedure as before.
The PowerShell file requires the ADSNotebook module which can be installed with
It should be run from the root of the repository and it will use the SQL File to create the notebook and save it and open it in Azure Data Studio
It includes some information at the top
and some instructions
Every cell is created minimised and there is a bunch of code at the top of each cell to make everything work which may be able to be improved. The first couple of cells need to be run first to set up some variables and tables and the first cell in the database information subsection needs to be run beofre any database cells.
DO NOT try to run all cells (ADS will just crash:-( ) It also will not work when scheduled
I have run both the procedure and the Notebook against a number of versions
The only "error" was the PowerShell not running elevated
Happy for comments