Add preemptive error checking
Add preemptive error checking.
One of our challenges is that it is too easy to break the get latest functionality. If a developer renames a column but doesn't rename all references (because he forgot to use Smart Rename) he is essentially breaking the database build. If I use Continues Integration to build the latest SQL changes, I have no bullet-proof way of ensuring that my database compiles at all time. I would like to ask Redgate to not allow a check-in which will break the build. I imagine that all that needs to be done is to ensure that first generation dependencies don't have errors. It would be nice if this is an option that can be turn on or off.
-
John Q Martin commented
This would be really useful if it was able to be put together.
I have tried using the find invalid objects in SSMS and it either times out does not return results for some reason.
-
Yes, I agree that this would be the ideal situation. We definitely hope to get there eventually.
-
Shmuel Tannenbaum commented
David, thanks for clarifying. Just as an aside, it would also be nice if in general if the RG check-in experience is as similar as possible to the one from Visual Studio. For example: It would be nice if I can enforce the same check-in policies as in TFS.
Anyway thank you again for your help! -
It's hard to say when we'll be able to do this. It's definitely a very nice idea that marries together two of our tools, so it ticks a big box for us. However, work would need to be done by the SQL Prompt team to expose this feature as a service to the SQL Source Control product, which would need to consume the service and expose this as an option somewhere. This would need an options dialog to be designed. I can't make any commitment as to when this might appear. In the meantime it might be worth highlighting the Find Invalid Objects feature to your developers and strongly advising them to run this as often as they can!
-
Shmuel Tannenbaum commented
Just to clarify, do you think this will be implemented just not in the near future, or it won't be at all? Because RG Support emailed me that they escalated this feature request to development.
-
If difficulty was the only barrier then we'd have a lot more features in the tools! It comes down to prioritization. There are so many good ideas and limited development resource. We haven't yet implemented a UI for the existing set of options (as you get in SQL Compare, for example) in SQL Source Control yet, so it's likely that this will take precedence over new features. I know it's frustrating, but if it's any consolation it's equally frustrating for us as well!
-
Shmuel Tannenbaum commented
I really appreciate that you are following up on this.
Yes, these are all good suggestions and I am aware of them. SQL Connect is not an option for some of us here, as we spend most of our day in SSMS, which is the natural place for DB development and which is why we went with RG to begin with (MS has DB projects for VS development). The Find invalid Objects is a great feature and we definitely use it, but again, I would like to know that my database has a bullet proof protection at any given time, without having to rely on people not to forget...I was told by the Support team that this request is being escalated to the development team. Are you saying you think it'll be rejected for the time being? Just wondering out loud, isn’t it just a matter of applying the find invalid objects to the Check-in (and allow it to be optional)?
Thanks again for all your great comments. -
That's a good point. It probably needs client-side support in TFS. I can't see this being on the near-term roadmap for SQL Source Control. One option you have is to use SQL Connect, as this is a Visual Studio plug-in. Another option is to encourage your developers to run 'Find Invalid Objects' in SQL Prompt before committing their changes. I would agree that it would be a great pre-check-in feature to detect these problems automatically.
-
Shmuel Tannenbaum commented
Yes that's true, good point. But let me ask you this: can CI be triggered by developers commiting SQL code in SSMS, using SSC? doesn't CI only get triggered by code checked-in in visual studio?
-
You can use the SQL Compare command line to achieve this. First create a new DB in your CI environment and then: sqlcompare.exe /scripts1:<DatabaseScriptsFolder> /server2:<CIServer> /db2:<RedGateCIDB> /sync . We have some resources linked from www.red-gate.com/ci which may be helpful.
-
Shmuel Tannenbaum commented
Well, how would TFS "build" the database? To the best of my knowledge It only knows how to compile code, not sql code, unless you are using Visual Studio SQL project. But I'm not, I'm using Redgate's... Am I missing something obvious here?
-
Some CI tools have a feature that allows you to check that the build works before the commit is accepted. TeamBuild has 'gated checkins'. TeamCity has pre-tested commits. See http://www.jetbrains.com/teamcity/features/delayed_commit.html . In theory if you have a CI build step that tries to build your database from scratch, it should pick up most cases of invalid objects. Is this something you have tried?