Like probably every SQL DBA, consultant, architect etc etc out there that has ever worked on or used SQL Server they will likely have their own personal collection of SQL Server Help Scripts.
So not unsurprisingly I also have such a collection – and so this is the purpose of this post!
The below is a link to my GitHub repo of my personal collection of scripts. BTW this isn’t all of the scripts, but is probably 50% of the ones I have lurking around.
These are either scripts I have developed in my own time over the years, or adapted from various other websites which I found handy at the time for whatever reason.
Where I have remembered that web site (like most people, which is unfortunately almost never) it was typically from sites like stack overflow etc, and if so I have tried to cite it as such to provide credits.
Quite a few of my scripts are in fact scripts that generate other scripts!
So in other words – its a script you run on a source SQL Server where the output of that script execution is in fact another script that performs some dynamic operation based on the source server configuration at the time the original script was run.
These are perfect for those times you need to create scripts for some later activity, such as to say backup or restore databases, recreate indexes, change database properties, set login properties, etc etc
The below is the link to the repo and a list of the scripts I have there. Read on!
Oh, but before we do that… I’m spelling out my usual caveats… sorry…
THESE SCRIPTS/CODE ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. LIMITED TESTING HAS BEEN PERFORMED ON THESE SCRIPTS/CODE AND THEREFORE THE AUTHOR DOES NOT WARRANT THAT ANY SCRIPT/CODE IS BUG OR ERROR-FREE. IT IS EXPECTED THAT ANY SCRIPT/CODE UNDERGO YOUR OWN TESTING AND/OR VALIDATION BEFORE USAGE ON ANY CRITICAL SQL SERVER PLATFORM. THESE SCRIPTS MAY BE A COLLECTION OF MY OWN CODE COLLATED OVER MANY YEARS, OR OTHER CODE I HAVE LOCATED ON THE WEB OFTEN WITH AN UNKNOWN ORIGIN. WHERE CODE LINAGE HAS BEEN SPECIFICALLY IDENTIFIED IT WILL BE CITED AS SUCH BACK TO THE ORIGINAL AUTHOR OF THAT CODE.
GitHib Repo – Collection of Downloadable Scripts
List of SQL Script Files
I have tried to keep the names of the script files in a self-describing way so that you can tell what they do. Each file also has a header that explains a little about what it does.
AND of course, as I always say, please test this yourself as your results may vary!
Disclaimer: all content on Mr. Fox SQL blog is subject to the disclaimer found here