Best Practices for Storing and Organizing Scripts

best practices

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!

Best Answer

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.