Find a Deleted object
michaelmm
Posts: 14 Bronze 3
A View was deleted, and we're not sure when. Using Source Control it's easy to check the history for an existing object. How does one find a deleted object? It's got to be somewhere in the Source Control history. We don't see a way to search the revision history. We could scroll through each and every revision for drops, but that's a bit tedious and would take longer than just starting over. Thanks,
Tagged:
Answers
Might be easier to use the underlying source control tool.
DevOps Mentor and Coach
Director of DLM Consultants
Creator of Speaking Mentors
Microsoft Data Platform MVP
Friend of Redgate
Twitter / LinkedIn
Or, if accidental drops are a regular issue for you, you could automated a test on your build server to throw a warning whenever an object is dropped. There are a few ways to achieve that.
DevOps Mentor and Coach
Director of DLM Consultants
Creator of Speaking Mentors
Microsoft Data Platform MVP
Friend of Redgate
Twitter / LinkedIn
Still, I like the philosophy of every time you hit a bug/error, write a test to avoid it repeating. 😝
DevOps Mentor and Coach
Director of DLM Consultants
Creator of Speaking Mentors
Microsoft Data Platform MVP
Friend of Redgate
Twitter / LinkedIn
Thanks for reporting this. I see why it seems like the history feature would solve this in SQL Source Control, but it doesn't. This is very helpful feedback for us in thinking through user stories for viewing version control history.
I am not sure if you are using this in an automation context, but one other scenario we are currently working on is more flexible alerting of commands like DROP, TRUNCATE, RENAME in automation contexts-- say to possibly warn or fail on a build when these keywords are present. (I don't mean that would negate the value of viewing history to find when something was dropped or renamed, but it seems like a complimentary feature and both would be desirable.)
Cheers,
Kendra
We also have the great need to be able to use such a feature (we use SVN). Are there any plans to enable this, if so, when will the feature come?
Currently with the SQL Source Control object history feature you can either:
- View the history of an existing object
- View the history of the database by commit message
You can find the history of a deleted database object via the second option, but it may be somewhat cumbersome/ tedious to find.I explain this to say that there is a solution for this, but it will generally only be efficient if you are looking for something that happened in a recent commit OR if commit messages can be relied on to indicate when drops occurred.
I've searched our User Voice forum and I don't see that we've had this as a feature request before from folks. If you wouldn't mind creating an item there, it would help us to track the request. If you can describe how often you use the object history feature and if you have any policies/process/change requirements around dropping or renaming objects, that would also be really useful for us.
Kendra
https://redgate.uservoice.com/forums/39019-sql-source-control/suggestions/37202038-add-option-to-view-commited-deleted-object-code-fr