String Comparisons in SQL: The Metaphone Algorithm

When exploring the use of the Metaphone algorithm for fuzzy search, Phil couldn't find a SQL version of the algorithm so he wrote one. The Metaphone algorithm is built in to PHP, and is widely used for string searches where you aren't always likely to get exact matches, such as ancestral research and historical documents. It is particularly useful when comparing strings word-by-word. With a SQL version, it is easy to experiment on large quantities of data!… Read more

The Harsh Reality Behind Big Data Misuse

Big Data has its origin in science, but it is now being used commercially to increase the information that organizations have about people. This information can uniquely identify individuals and reveal their likes, habits, propensities and wealth. The power of this information is so great that legislation on its use is having to become more … Read more

Metaprogramming

Over the history of personal computing, it seems that the best software was written by a team of five or fewer programmers. CP/M, the first PC operating system was built by one guy, Gary Kildall, though he got parts from others such as Gordon Eubanks. MSDOS originated in QDOS, again written by one person, Tim … Read more

Tying Down the Source Code

Database source code analysis can flush out weakly-authenticated database users, over-privileged users and roles, or stored procedure code that concatenates a parameter directly into the dynamic SQL string that is to be executed, and so is vulnerable SQL injection. This is great for the development team, but it is also wonderful for the hacker. Getting … Read more

Bridging the DevOps Divide

What’s the main obstacle to implementing a DevOps approach in your organization? In a recent “State of DevOps” survey conducted by Redgate, the second most popular answer to this question, after “lack of skills”, was “lack of alignment between development and operations teams“. Hmm, so you can’t do DevOps until you have a DevOps culture. … Read more

How to allow nulls in unique fields

An interesting workaround using unique fields Unique fields in SQL Server are created using unique constraints or unique indexes, furthermore, each unique constraint uses a unique index. Regardless of using unique constraint or unique index, the field can accept null values, however the uniqueness will result in only accepting a single row with null value. The solution … Read more

The Dangers of TechnoMarketingBabble

Everyone’s encouraged to be a content producer these days. It’s not marketing, it’s content! Sometimes the tell-tale signs are obvious. The author feels obliged to lapse into unrestrained hyperbole in the first paragraph, proclaiming unprecedented greatness for some unproven new feature or technology that represents a “total revolution” in the way you tackle a certain … Read more

Virtue in the Virtual

Are we now seeing just a frisson of excitement amongst database professionals at the potential of virtualization, and containerization technologies? I read with interest Andrew Pruski’s recent post on SQL Server and containers. Wow, I thought: so I can now run a Docker SQL Server Express in a Hyper-V Container on Windows Server 2016! Then … Read more

When Stored Procedures Go Bad

It is far easier to work out what is wrong with a slow-running SQL query than one that shows erratic performance. DBAs will groan when a process occasionally performs terribly without apparent reason. There is always a good chance that this is a symptom of the painful problem of parameter sniffing. It can afflict database … Read more

Skilling and De-skilling

Not long ago, I was having to do a fairly simple DBA task onsite. It involved database provisioning by copying a database from one server to another, something I’ve done countless times. I was taking a backup of the source and restoring it under another name on the other server to create the target database. … Read more

Removing the Clutter from Graphs

You can quickly get an audience to see patterns and trends in data if you present that data graphically. Data visualization is often the most persuasive of mediums; and yet, it’s so easy to get it very wrong. With any of the rich variety of available data tools, it is the work of a moment … Read more

PSYaml: PowerShell does YAML

PSYaml is a simple PowerShell module that I’ve written that allows you to serialize PowerShell objects to “YAML Ain’t Markup Language” (YAML) documents and deserialize YAML documents to PowerShell objects. It uses Antoine Aubry’s excellent YamlDotNet library To start, you can simply load the PowerShell file and the manifest from its home on GitHub PSYaml … Read more

On Being Economical with the Truth

A while back, I attended a presentation about a suite of software that allowed IT managers to track in some detail the progress of a development project, via static code analysis, a range of source control metrics and other magic. Bathed in these insights, management could instantly track the detail of what was going on … Read more

SQL Server Geeks Annual Conference

A couple of weeks ago I was privileged to be able to travel out to Bengaluru in India to attend SQL Server Geeks Annual Summit. It was my first time at the event and my first time in India. While the food was wonderful and the people were great, please allow me to focus on … Read more

Careful With Trustworthy Setting

Trustworthy database setting is an easy solution for some problems in the server, especially cross database access. However, this setting has also a security problem in some scenarios. The scenario that has a security break is the following: One or more databases are owned by a user with ‘sysadmin’ rights. If the databases were created … Read more

JSON and the Arguments

Now that we’re getting better support for storing JSON (JavaScript Object Notation) in databases, what is it really giving us? Whatever else, the technique of “stuffing data into a JSON blob and adding an index” doesn’t always absolve us from the task of carefully designing and normalizing our database schema. There are many advantages, I’ll … Read more

The SQL of Textonyms

The task of finding textonyms in SQL involves importing a list of common words and doing transformations on every word to convert it into what you'd need to type into the numeric keypad of your mobile phone to get that word. It's not that hard to do, but what is the quickest and most efficient way of doing it? Phil Factor investigates.… Read more