Phil Factor

Phil Factor (real name withheld to protect the guilty), aka Database Mole, has 40 years of experience with database-intensive applications. Despite having once been shouted at by a furious Bill Gates at an exhibition in the early 1980s, he has remained resolutely anonymous throughout his career. See also :

Follow on

29 June 2022
29 June 2022

Searching through a database via SQL

0
8
Imagine that while developing or testing a SQL Server database, you get an error message mentioning a database object, and you scratch your head, and mutter ‘by the bones of the saints, what is that?’. If it is a small database, then you can glance, maybe, at the browser pane. Once it gets to any … Read more
0
8
04 November 2020
04 November 2020

Unwrapping JSON to SQL Server Tables

0
13
If you know the structure and contents of a JSON document, then it is possible to turn this into one or more relational tables, but even then I dare to you claim that it is easy to tap in a good OpenJSON SELECT statement to do it. If you don’t know what’s in that JSON … Read more
0
13
01 August 2020
01 August 2020

Temporary Tables in SQL Server

Temporary tables are used by every DB developer, but they're not likely to be too adventurous with their use, or exploit all their advantages. They can improve your code's performance and maintainability, but can be the source of grief to both developer and DBA if things go wrong and a process grinds away inexorably slowly. We asked Phil for advice, thinking that it would be a simple explanation.… Read more
13 May 2020
13 May 2020

Database Kill and Fill

0
6
When testing database code in development, you usually have a lot of tests that aim to prove that the various processes such as ETL, reporting or the processing of an order, still work as they always did. If it is a changed process, you need to ensure that, from a known dataset, the process yields … Read more
0
6
06 May 2020
06 May 2020

Tackling Imperial and US Customary Measurements in Databases

The old measurements of length, area, volume and weight in the UK and the States refuse to die. They are known as the Imperial and US customary measurement systems respectively. Not only are they a natural way of dealing with approximate measurements, and tied to human dimensions, but they are no longer difficult to calculate. … Read more
19 February 2020
19 February 2020

Grappling with sp_describe_undeclared_parameters(). The Hows, Whys and Wherefores.

0
7
sp_describe_undeclared_parameters() promises a great deal, but delivers less. It was added mostly for executing application queries via sp_prepare using a TDS link, but has several quirks and restrictions that rather spoils its more general use. It is designed to provide you with all the parameters of a batch. You might use it when a SQL … Read more
0
7
17 February 2020
17 February 2020

Using sys.dm_exec_describe_first_result_set_for_object. The Hows, Whys and Wherefores.

0
5
I’ve been working on a project unkindly nicknamed ‘The Gloop’ because the code is a bit amorphous. Basically, it is an approach to documenting SQL Server databases, using the facilities provided such as the metadata views and DMFs. Although it is relatively simple to record the result returned by a table-valued function I’d rather neglected … Read more
0
5
03 December 2019
03 December 2019

The Gloop: An Easier way of Managing SQL Server Documentation

Here, in this blog, I’m continuing a theme that I started in a previous blog, ‘What’s in that database? Getting information about routines’. In that blog, I just wanted to provide a few examples of extracting metadata from SQL Server into Powershell and hinting about why one might want to do it. I’ll now show … Read more