I am about 10 months in to my DBA role and I am already accumulating quite the collection of scripts. Does anyone have any best practices or recommendations on how to store all of these scripts? I manage about 70 instances of SQL server and am looking for a way to have quick access to all of these scripts as I need them throughout the day and right now they are just piling up in a file system folder.

Is this the best way? Are there 3rd party tools that help organize them? Anyone have an amazing solution/recommendation?

Thanks ahead of time!

| improve this question | | | | |

Get them into source control, pronto. They are your code, your source of truth about how the environments should be configured and operate. They are as important as the application and schema and deserve the same level of care and attention.

Once there you can version and branch them as required. Having 20 copies with no indication which is for what purpose will be a thing of the past.

Within the root folder I'd split them by purpose. For me this means a sub-folder for migration scripts, one for analysis, one for maintenance etc. Use what makes sense for your environment and for your way of thinking.

| improve this answer | | | | |

I bet there is one within ssms object explorer settings generally where you see pre loaded sql scripts like backups, create logins etc... are stored. Also the best one I've been using and very famous or the one I personally like is GitHub. You may find various others like Bitbucket etc available online.

Moreover in my early days I used to have a DBA database of my own where I will keep data related to scripts that I use on my daily troubleshooting or check activities

Also I don't know how useful it is but u may find redgate swl script manager Useful

| improve this answer | | | | |
  • I will look around in SSMS, I wasn't aware of anything in there where I could store scripts that I use on a regular basis, this would be very helpful! I have heard of GitHub but never used, I will take a look at that and the redgate solution as well. Thanks for the tips! – TattooedDBA Jan 24 '19 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.