How can we help you today? How can we help you today?
allmhuran
Sure, attached. ( Edit:I  can't see my attempted attachement anywhere, so here it is on pastebin https://pastebin.com/P5Ds6A11 ) I think some of the problems with trying to set up formatting probably come up because there are two different formatting "regimes" in a SQL statement. The first is the formatting for SQL clauses themselves.. select, from, where, and so on, the names of the relations being queried, joins, etc. But a second regime exists, which is a formatting regime for expressions. That might mean case statements, but it might also mean logical constructs used in where clauses, or inside the join, or function calls for column value expressions, and things like that. While SQL prompt does recognize case statements as an independently format-able construct in their own right, it doesn't seem to make that more general distinction between scalar-value-returning-expressions vs SQL clauses. For instance, the construct inside a where clause (or a join) is actually a scalar expression returning a boolean, and should fall under an "expression formatting regime" as opposed to a "clause formatting regime". You can think of the where clause as creating a sort of attachment point where an expression is about to go, and I should be able to set the "cursor start position" for that expression via SQL prompt, after which expression formatting should take over and act as if that chosen position was the left edge of the screen, so to speak. / comments
Sure, attached.( Edit:I  can't see my attempted attachement anywhere, so here it is on pastebin https://pastebin.com/P5Ds6A11 )I think some of the problems with trying to set up formatting probably...
0 votes
Thanks for your reply. As far as the general branching structure, sure, I agree that it's not the role of SQL SC to define this. I included that part of the question just in case anyone had successfully constructed a similar pattern with the inclusion of SQL SC. Let's pass over that one. But I think the second part of the question is a canonical requirement of a source control system. Particularly the part where we need to think about how code under revision control is synched to code that has been built and is running in an environment. With SQL, deployment *is* building. SQL Compare must run against an actual environment, which leaves different change paths for what is in source control vs what is deployed. To put it another way: Even if it was possible to use SQL SC and SQL Compare to apply a cross-branch merge style change script within revision control (which it currently is not), a deployment would still require a second use of sql compare (this time between source and deployed environment). An alternative approach might be to change the pattern: Instead of going from source branch 1 to source branch 2 to deployment in environment 2, one could go from source branch 1 to enviornment 2 via sql compare, and then check in changes in environment 2 to synch source branch 2. But this significantly increases the amount of work when a developer has to do a merge... indeed, it means a lot of the time developers cannot do merges, since developers don't have the authority to deploy code outside their own environment. / comments
Thanks for your reply. As far as the general branching structure, sure, I agree that it's not the role of SQL SC to define this. I included that part of the question just in case anyone had success...
0 votes
Addendum: Exploring this idea a little further, right now it seems that if I want to use SQL Compare to perform a merge of the database side of a project (leaving TFS to deal with application code only) during, for example, a reverse integration step, I would indeed have to run a comparison between: source: Dev branch OR dev database target: UAT/RC/Production database (not branch) This has a few implications: 1) The UAT/RC environment must exist as an actual database. It can't just be code in source control. This is true even if there is no actual testing happening, just a reverse integration process. So I have to provision environments and resources to house a database that nobody may even be connecting to, just in order to do a revision control operation. 2) If there is no UAT branch, then the comparison must necessarily be between the dev database and the production database. This means either: a) Developers must be granted the permissions required to perform comparisons against the producton database, OR b) The DBA must take on the responsibility of resolving conflicts in the developers' code, OR c) A third database be provisioned that is an exact, up to date replica of production, with the addition of the required developer permissions. / comments
Addendum: Exploring this idea a little further, right now it seems that if I want to use SQL Compare to perform a merge of the database side of a project (leaving TFS to deal with application code ...
0 votes
Another addendum! I guess I'm struggling to understand how to use the tools to solve the problems that need to be solved. Instead of talking from a branching structure pont of view, let me try a different approach, from a developer process point of view. The developer makes changes and commits them to source control. This part is obvious and simple enough. We now need to create a "build" that is deployed to a UAT environment. This build may incliude custom migration scripts or data creation scripts. Let's assume that these scripts are sitting in source control and tied to the object definitions that are being looked after by SQL SC. Let's say we use SQL Compare to help us create this build script, and it's passed off to the DBA and infraustructure guys for execution. Now, assume the build is good and we pass UAT. Time to go to production. As long as the prod environment is in synch with what the UAT environment was prior to release, we're all good so far. We take the build script and apply it to production. But what does the developer do with the revision control system at this point? Let's say they now merge their development branch into the production branch in order to make sure the same changes from the build are reflected in the "production" code line. But wait... they're NOT the same changes. The changes made to the real environment were made by applying a build generated via SQL compare. But the changes made to the code under revision control was made by merging via TFS. I certainly cannot, or will not, trust that these two independent processes are going to result in identical changes, which means that what is in revision control as "current production code" may not reflect what is actually running in the enviornment. This is unacceptable. How do we resolve this? On the application side this problem doesn't exist. People merge using TFS and then build FROM the merged code. There is only one merge process. But, even with the redgate tools, we can't seem to do that on the database side. How do people reconcile these two processes? / comments
Another addendum! I guess I'm struggling to understand how to use the tools to solve the problems that need to be solved. Instead of talking from a branching structure pont of view, let me try a di...
0 votes