Ordering T-SQL Scripts with Git and PowerShell

  • Comments posted to this topic are about the item Ordering T-SQL Scripts with Git and PowerShell

  • Topics of saving scripts into source control, such as Git, are great. And I'm all for it. However, I'm sure that where I work the DBAs don't put any scripts, databases, etc., into source control. I believe a big part of this is the tools they use. In the online training I've done, to save the database schema, SQL scripts and so on, in source control, those training always did so using SSDT and Visual Studio. None of the DBAs have Visual Studio installed. It's SSMS or nothing.

    So, what plug-ins for SSMS are there for working with TFVC (which is what we use)?

    Kindest Regards, Rod Connect with me on LinkedIn.

  • Hi Rod.   TFVC supports Git as well as TFS.   From MS docs:  "Azure DevOps Services and TFS provide two models of version control: Git, which is distributed version control, and Team Foundation Version Control (TFVC), which is centralized version control."

    Regarding SSMS plugins, the interfaces to build plugins are controlled by MSFT, but I believe Red Gate offers plugins for SSMS.

  • Hi Paul,

    Thanks for your reply. I was aware that TFS supports both TFVC and Git, at least from TFS 2015 onwards. We're currently on TFS 2015, so Git is possible. Except that people here don't want to use Git. 🙁 So, I use it personally, but getting others to adopt Git here is a losing proposition.

    Thank you for letting me know that Red Gate may have a plugin for SSMS to work with TFS/TFVC. I'll investigate that. Hopefully, they'll consider buying it.

    Kindest Regards, Rod Connect with me on LinkedIn.

  • Thanks for the input . . .  we're also looking into a building an SSMS plugin . . . feel free to get in touch with us at support@windocks.com, and we can keep you posted on our plans.

  • I had to create my own SQL deployment package using PowerShell during the CI stage. I merging all the programmatic scripts to 1 file, data changes to another, and schema changes to another file.

    I had to create PS scripts to execute the SQL package for the CD.  I wish this exited long time ago.

    The question I have is what is your process to handle rollback execution?

     

  • Hello Ryan.   We recommend that rollback scripts are developed as part of each project (feature), so that they can be applied when the feature or upgrade scripts fail to get the job done.   I also see that it's popular among our clients to take an "all or nothing" approach to script success . . . or rollback.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply