Sample Header Ad - 728x90

SELECTs in Database Change Log and Source Control

2 votes
1 answer
60 views
We are overhauling the way that we store our database in source control and keep a change log of it. I was reading the following article: http://thedailywtf.com/articles/Database-Changes-Done-Right , and in the Short Section of "The Taxonomy of Database Scripts" it describes the three types of scripts (QUERY, OBJECT, and CHANGE). I like the idea of generalizing scripts into these three categories but I'm wondering about the QUERY type. Questions: - Why would someone want to put a SELECT statement into source control outside of an object? - The database will change afterwards and make the QUERY script unusable, what then? - The data may change returning a different result set, this would defeat purpose of source control, what then? - Would the original result set have to be saved to solve the 2nd and 3rd issues? - What is an example of a SELECT statement that might be put into source control? - Wouldn't a INSERT statement work better and store the results in a table as in baselines? I just can't see the purpose of storing SELECT statements into source control. If there is a purpose could someone please answer the above questions and maybe state the pros and cons of storing a SELECT statement into source control?
Asked by Gander7 (197 rep)
Nov 27, 2014, 01:39 AM
Last activity: May 19, 2015, 05:36 PM