How to store/organize all of these scripts?

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.


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