Monthly Archives: September 2013

Extracting Fault Cuts directly from the database, Kingdom SQL

I have come into a situation where a Geologist names his fault cuts as the throw of the fault cut. This was done as a workaround to enable posting both depth and throw on vertical sections. But the unintended consequence is that there may be multiple fault cuts in a single well with the same name. The spreadsheet function in Kingdom will only display one of the fault cuts when this happens. So I turn to the SQL database to extract the fault cuts manually. Below is the SQL query that will pull API, Author, Fault Cut Name, Fault Cut Depth, Fault Cut Throw, Borehole Name, Well Name, and Well Number from the database.

** this SQL command will only pull fault cuts that have a throw. If throw is not entered for a fault cut, it will be ignored.

dbo.T000000_T_Borehole.Uwi as “API”,
dbo.T000000_T_Author.Name as “Author”, as “Name”,
dbo.T000000_T_SurfacePick.CustomData as “Throw”,
dbo.T000000_T_Borehole.Name as “Borehole Name”,
dbo.T000000_T_Well.Name as “Well Name”,
FROM dbo.T000000_T_SurfacePick
inner join dbo.T000000_T_Author on dbo.T000000_T_Author.ID = dbo.T000000_T_SurfacePick.OwningAuthorID
inner join dbo.T000000_T_AuthoredName on dbo.T000000_T_AuthoredName.ID = dbo.T000000_T_SurfacePick.AuthoredNameID
inner join dbo.T000000_T_Borehole on dbo.T000000_T_Borehole.ID = dbo.T000000_T_SurfacePick.BoreholeID
inner join dbo.T000000_T_Well on dbo.T000000_T_Borehole.WellID = dbo.T000000_T_Well.ID
WHERE dbo.T000000_T_SurfacePick.CustomData > 0
order by dbo.T000000_T_Borehole.Uwi, dbo.T000000_T_SurfacePick.PickDepth