Can Visual Studio share a SQL Source Control project in TFS?

I have installed the trial version of SQL Source Control, and have been successful with connecting one database to TFS source control, and updating source control, etc.

Is it possible to also connect to the same database project in TFS using Visual Studio 2017? It does not seem to be possible because Visual Studio looks for a solution file in TFS, which SQL Source Control does not seem to create.

Answers

  • DiogoDiogo Posts: 67 Silver 5
    edited August 15, 2018 7:07AM
    I think you should be able to checkout the SQL Source Control folder with Visual Studiobut I am not sure if you would gain much with that.  Which tasks would you like to do in Visual Studio?

    Have you had a look at SQL Change Automation which has a Visual Studio extension?
    https://marketplace.visualstudio.com/items?itemName=vs-publisher-306627.RedgateSqlChangeAutomation

    https://www.red-gate.com/products/sql-development/sql-change-automation/index

  • AlexYatesAlexYates Posts: 264 Rose Gold 2
    edited August 15, 2018 7:58AM
    You can probably do it the other way around if you desperately want to - but I don't believe Redgate officially support it and wouldn't recommend it.

    If you *really* want to be able to use both a solution with a Visual Studio SSDT Database Project and SQL Source Control on the same project create the SSDT project in Visual Studio first to generate your .sln file, then connect with SQL Source Control (which simply wants a set of .sql files and isn't picky about folder structure).

    That said - you are likely to hit issues.

    • SQL Source Control might put SQL files in odd locations.
    • SQL Source Control won't have built in support for various SSDT features, such as SQLCMD variables or partial projects.
    • Since this is not officially supported by either Redgate or Microsoft I would expect a few dragons lurking in the details and neither party would be willing to commit to avoid making breaking changes in the future.

    If you really want to work in Visual Studio I would recommend either sticking with SSDT or using Redgate's SQL Change Automation Visual Studio extension (formerly known as ReadyRoll). However, the Redgate Visual Studio extension works differently (some would say better) than either Redgate SQL Source Control or SSDT so I would do a little research first.

    Alternatively, if you really like SQL Source Control, use that exclusively and don't try to integrate it with an SSDT project.

    As I said, you probably could create a hybrid SQL Source Control/SSDT project if you really wanted to - just please don't.
    Alex Yates
    DevOps Mentor and Coach

    Director of DLM Consultants
    Creator of Speaking Mentors
    Microsoft Data Platform MVP
    Friend of Redgate
    Twitter / LinkedIn
Sign In or Register to comment.