Python in SQL Server

Anyone using R in SQL Server employs the procedure sp_execute_external_script, the first parameter of this being the language to use. The documentation rather obliquely says that “the script must be written in a supported and registered language“. Until recently, the only language was R, but now a second supported language, Python, has appeared! Yes, at … Read more

Generating HTML from SQL Server Queries

You can produce HTML from SQL because SQL Server has built-in support for outputting XML, and HTML is best understood as a slightly odd dialect of XML that imparts meaning to predefined tags. There are plenty of edge cases where an HTML structure is the most obvious way of communicating tables, lists and directories. Where data is hierarchical, it can make even more sense. William Brewer gives a simple introduction to a few HTML-output techniques.… Read more

Statistics in SQL: Kendall’s Tau rank correlation

Statistical calculations in SQL are often perfectly easy to do. SQL was designed to be a natural fit for calculating correlation, regression and variance on large quantities of data. It just isn't always immediately obvious how. In the second of a series of articles, Phil factor shows how calculating a non-parametric correlation via Kendall's Tau or Spearman's Rho can be stress-free.… Read more

The Oxford Comma and Me

Many people in IT, even at Redgate where I work, see the job title “Editor” and think I spend most of my time fixing spelling mistakes, adding Oxford Commas, and thwarting an author’s ambitions to end a sentence with a preposition. They are sometimes bemused, therefore, when they learn how long a proper technical edit … Read more

Avoiding the Slide From DevOps to DevOops

If you roll out DevOps across an organization before it is culturally prepared for it, you will see warning signs that the initiative is failing. These are: Team members complain of unmanageable workloads Requirements, quality management and metrics get neglected; customer complaints increase You promote and reward the ‘firefighters’ rather than the staff who prevent … Read more

Glasnost in IT: Discarding the Old Certainties

Three of Redgate’s tools are now part of the 2017 release of Visual Studio Enterprise (as announced last week), as components of the Data Storage and Processing ‘workload’. Some might be surprised to find third-party tools being included in the Visual Studio installer, but it’s an interesting sign of the times. No longer can any … Read more

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