Drop/Create Git
bkillen
Posts: 4 New member
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.
Any Advice?
If Exists(Select name From sys.objects Where name = 'XXXXX')
Drop Procedure XXXXX
GO
Create Procedure XXXXX
Any Advice?
Best Answer
-
Kendra_Little Posts: 139 Gold 3Ah, 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
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