The SQL of the Feast Days of Western Christendom

I’ve been intrigued for a long time by the Christian feasts. Nowadays, we start getting excited about Christmas around July, and it is considered by commerce to be fair-game as a de-walletizing activity from Halloween onwards. I would like far more feast days to get excited about. Our ancestors had so many feast days that … Read more

Late in the Day for a DBA

I first met Joe when I went to Woodworking evening classes several years ago. I saw him from across the room. He was at the lathe, turning a bowl. There was something about the careful, diligent way he was working that activated my DBA-dar. I approached him. “You’re a DBA, aren’t you?” I asked. He … Read more

Dependencies and References in SQL Server

It is important for developers and DBAs to be able to determine the interdependencies of any database object. Perhaps you need to work out what process is accessing that view you want to alter, or maybe find out whether that table-type you wish to change is being used. What are all these dependencies? How do you work out which are relevant? Phil Factor explains.… Read more

Soft Skills for the Developer

(Guest Editorial for the Simple-Talk newsletter) In the rush to recruit a developer to fill a gaping void in a development project, it is sometimes easy to forget the relative importance of the skills you need. We were building a complex middleware architecture based on SOA principles with distributed transactions. The task was daunting, and … Read more

Typoglycemia: The PowerShell and the SQL

Typoglycemia is the ironic name, (derived from Hypoglycemia) given to the phenomenon that many readers can understand the meaning of words in a sentence even when the interior letters of each word are scrambled. They appear to recognize words by the outermost letters, the length, the letters used and the context.  As long as all … Read more

SQL Server: The Neglected Features

Have you ever experienced that moment in an exam, frantically scribbling your answer to the final question, when the invigilator looks sternly across the room and says “time’s up, now cease writing and put down your pens”? I sometimes imagine this happening to the developers in the server division of Microsoft. SQL Server has several … Read more

Microsoft and Database Lifecycle Management (DLM): The DacPac

The Data-Tier Application Package (DacPac), together with the Data-Tier Application Framework (DacFx), provides an alternative way to automate the process of scripting out, or deploying a SQL Server database, reporting on changes, or checking version-drift. As such, it seems to provide an obvious cost-free start for tackling automated Database Delivery as part of Database Life-cycle Management (DLM). We asked Phil Factor if it is ready for Prime-time.… Read more

Can Code Review Be Automated?

I was scanning the API of DacFx, the ‘engine’ of SSDT, and became interested in the facility it contains for automating SQL code reviews. DacFx allows you to parse the SQL code sufficiently to do static code analysis, to scan for heresies, deprecated code and code that doesn’t ‘conform to corporate policy’. Dave Ballantyne has … Read more

UWP: The Platform Formerly Known as Metro

Three years ago, I listened to a keynote at a developer conference. The man from Microsoft beamed confidently at the vast auditorium and said “I can tell you confidently that in a year’s time, you will all be writing Metro applications for a huge marketplace”. We clapped, but as the keynote proceeded and we saw … Read more

Spinach and Database Development

A little while ago Phil got to thinking about his garden, and the myths and misinformation that forced inferior food down the gullets of children. This was an example of bad data, and Phil wants it gone. Below is a video (and transcript) that Phil gave as the keynote of SQL Saturday Exeter. The Transcript … Read more

Documenting your SQL Server Database

One of the shocks that a developer can get when starting to program in T-SQL is that there is no simple way of generating documentation for routines, structures and interfaces, in the way that Javadocs or Doxygen provides. To embed the documentation in the source is so obvious and easy that it is a wrench to be without this facility. Phil Factor suggests a solution. … Read more

The Database Neighbours From Hell

In the Windows environment, there seems little safer for application design than a rather staid single-tiered architecture making ODBC/JDBC calls to the RDBMS. I can say this with years of experience in developing applications ranging from the dull but worthy, to the esoteric. However there is an interesting long-term cost to taking the easy route … Read more

Schema-Based Access Control for SQL Server Databases

Access-control within the database is important for the security of data, but it should be simple to implement. It is easy to become overwhelmed by the jargon of principals, securables, owners, schemas, roles, users and permissions, but beneath the apparent complexity, there is a schema-based system that, in combination with database roles and ownership-chaining, provides a relatively simple working solution.… Read more

Converting XML files to YAML or PSON

The other day, I needed to convert a whole stack of XML files to YAML.  Actually , I would have settled for a conversion to JSON, but for some reason, the built-in cmdlet wouldn’t do it. I was trying to figure out a way of doing the YAML conversion when I suddenly remembered I’d actually … Read more

For the Love of Stored Procedures

It is an exaggeration to say that I like stored procedures. They are an essential if somewhat dangerous part of the Sybase and SQL Server landscape, rather like a volcano, bog or swamp. If you use a stored procedure in the same way as a procedure in any other language, you soon end up in … Read more

A Start with Automating Database Configuration Management

For a number of reasons, it pays to have the up-to-date source of all the databases and servers that you're responsible for in a central archive, in version control, and this is a job that is best automated. If you enlist the help of SQL Compare Pro, you can create a Powershell-based system that can be extended to warn you of changes, roughly when they happened, with a report of exactly what changed and how.… Read more

String Comparisons in SQL: The Longest Common Subsequence

Relational databases aren’t really designed to deal easily with arbitrary sequence, though this is improving with the window functions. Strings and text are sequences. Lists are often sequenced.  If you hear people describe an entity such as an invoice in terms of its ordinal sequence ‘the first invoice’ or  ‘the fourth invoice’, then you know … Read more

String Comparisons in SQL: Edit Distance and the Levenshtein algorithm

Sometimes you need to know how similar words are, rather than whether they are identical. To get a general measure of similarity is tricky, impossible probably, because similarity is so strongly determined by culture. The Soundex algorithm can come up with some matches but insists that, for example, ‘voluptuousness’ and ‘velvet’ are similar. Family genealogists … Read more