Drop/Create Git

Our App developers want to store objects in GIT as a drop/create. I am having issues using Red Gate Source control because red gates source control does not seem to be able to accommodate this. The top of every procedure/view... has this at the top.

If Exists(Select name From sys.objects Where name = 'XXXXX')
Drop Procedure XXXXX
 GO 
Create Procedure XXXXX


Any Advice?

Best Answer

  • Kendra_LittleKendra_Little Posts: 139 Gold 3
    Ah, I see.

    With SQL Source Control, the behavior is that it provides a standardized way of committing the files. But these are not designed to be deployment scripts -- for many object types (tables, etc), that wouldn't work at all. 

    There are a few options to configure deployments for SQL Source Control projects

    I don't know if your app development team holds licenses for SQL Compare or any other Redgate products, but if they do then there are options for them to create deployment scripts which include those re-runnable headers in them -- but this does require having SQL Compare or another tool to create those deployments.

    Happy to help give more detail on those if that would be helpful.

    Cheers,
    Kendra

Answers

  • Hi @bkillen,

    SQL Source Control isn't designed for this use case-- the files committed to the repo are designed to be purely the object definition rather than a deployment script.

    Can I ask more about the use case / why this is important for the team? 

    Cheers,
    Kendra
  • bkillenbkillen Posts: 4 New member
    Hello Kendra. I wish I knew the answer. From what I've been told the app developers want the ability to take a script that has that header and be able to run it over and over.
Sign In or Register to comment.