Does SQL Source Control work with Azure Data Studio?

pablolernerpablolerner Posts: 27 Bronze 1
edited May 27, 2020 6:35PM in SQL Source Control
I am using Management Studio as the rest of my team, but would really like to move to Azure Data Studio. Does Red Gate's SQL Source Control work with it? And, if so, will it create any problems if i use source control in ADS while other members of my team still use Management Studio?

Best Answer

  • David AtkinsonDavid Atkinson Posts: 1,458 Rose Gold 2
    Answer ✓
    @pablolerner - There is no integration for Azure Data Studio at this stage, but there's no reason why you can't use ADS (or any tool for that matter) to make modifications to your development database and use SQL Source Control in SSMS alongside this. 

    SQL Source Control will identify changes to your development database by comparing this to what is stored in version control. It is agnostic to the tool that makes the database change. This means that your teams can develop using SSMS, ADS or both without any interoperability issues.

    We have plans to deliver a standalone (ie, not integrated in SSMS) version of SQL Source Control, which means you won't need SSMS loaded, and there may be a preview of this later in H2 this year.
    David Atkinson
    Product Manager
    Redgate Software

Answers

  • pablolernerpablolerner Posts: 27 Bronze 1
    Thanks, David. Running both applications, ADS and SSMS side by side on my PC is not a good solution for me. I will just stay with SSMS for now, but looking forward for the standalone version, if integration is not possible.
    Now that I think about it, I also have SQL Compare. Wouldn't it work as a standalone application to commit changes from development database to Source Control? We currently use it to implement from Source Control to our production database. I guess it might work?
  • @pablolerner - Yes, SQL Compare, or its command line, sqlcompare.exe, can be used to synchronize changes from your database to a scripts folder on disk. So in theory you could set up a preconfigured batch file which syncs your dev DB changes to your project folder.

    David Atkinson
    Product Manager
    Redgate Software
  • pablolernerpablolerner Posts: 27 Bronze 1
    Thanks.
  • @pablolerner - to let you know that I've just tested the combination of using SQL Compare and Azure Data Studio together, and it works as expected. 

    You just need to create a SQL Compare project with your dev DB as the source and the SQL Source Control scripts folder in your Git working folder as the target.

    When you do the comparison, the screen that you see is effectively the same as you get in SQL Source Control's commit screen.


    Select the objects you want to save to your project and use the Deploy function to "deploy" the changes to your git folder.

    You can then use the build in Git in Azure Data Studio (or any Git client you like) to commit and push the changes.



    David Atkinson
    Product Manager
    Redgate Software
  • pablolernerpablolerner Posts: 27 Bronze 1
    wow, well, thanks, this is great, but unfortunatelly we are not using Git, we are on Team Foundation Server. And I have tryed with SQL Compare setting my development DB as source and Team Foundation as target and it does not work since it forces to just create a script, and then I have to still use SSMS to upload it to Team Foundation.
  • @pablolerner - this is strange. If you've specified the source as a database, and the target as a scripts folder, you should have this choice.


    David Atkinson
    Product Manager
    Redgate Software
  • pablolernerpablolerner Posts: 27 Bronze 1
    edited May 29, 2020 3:15PM
    oh, no. I have tryed setting "Source Control" as the target.
    We usually set "Source Control" as the source and our production database as the target. That is how we implement changes in our production environment.



  • @pablolerner - ah, I see. That capability is there so you can generate deployment scripts based on comparing, for example, different versions of your database in version control. Can you try the scripts folder feature? It's possible that this might fall four of TFS's "locking" behaviour whereby it sets files to read-only (although I'd be surprised if this wasn't configurable).

    David Atkinson
    Product Manager
    Redgate Software
  • pablolernerpablolerner Posts: 27 Bronze 1
    Well, it does not look like the scripts folder will work for me since I still need to upload SQL objects to Team Foundations Server. So, I will be using ADS to develop, then SQL Compare to generate scripts and then need to open some other application to commit those scripts to TFS, maybe SSMS?
    That is too many steps. It is best if I just stick to our current model to use SSMS with Red Gate's Source Control. It is easier. And, when the new stand alone version of Red Gate's Source Control becomes available I will see my options.
    Thanks.
  • To avoid using an external tool, you would need TFS support to exist in Azure Data Studio, which is apparently possible via the VSCode extension, although I haven't tried it.
    David Atkinson
    Product Manager
    Redgate Software
  • pablolernerpablolerner Posts: 27 Bronze 1
    I see... well I will try to test it. thanks
  • @pablolerner - please report back when you do. It appears that this solution is the current official response from Microsoft as well! The vast majority of organizations have moved to Git - does yours have plans to move anytime?

    David Atkinson
    Product Manager
    Redgate Software
Sign In or Register to comment.