Wait For Data to be ready

Wait For Data to be ready

Here are two SQL Server based methods for waiting for data, and raising an alert if it’s not ready. I’ve designed them as simple templates which I can easily re-use and customise.

NULL: When a value is neither IN or NOT IN a list.

NULL: When a value is neither IN or NOT IN a list.

NULL is always a challenge for equality, I’ve written about it before. I recently produced some samples for training/explanation of NULL when it comes to IN and NOT IN, and thought I’d include it here.

Warning: Null value is eliminated by an aggregate or other SET operation

Warning: Null value is eliminated by an aggregate or other SET operation

In data warehousing where aggregation (GROUP BY) is one of the most common things done in queries, we often get the warning: Warning: Null value is eliminated by an aggregate or other SET operation In most cases what is happening is harmless. But what is happening? NULL in aggregation First we have to better understand…

Read More Read More

In SQL Server, not all spaces are equal

In SQL Server, not all spaces are equal

I recently had a challenge mapping attributes using a lookup table. I had the same customer name in two tables “bobs widgets”, but when I tried to join on the names, there was no match. To cut a long story short, there is more than one way to encode a space. This picks up from the…

Read More Read More

View running processes and their children

View running processes and their children

When using bash, ps is a very powerful tool for viewing running processes. I have built a script/library for manipulating its output to create trees for either running shell scripts, or user sessions. This allows me to see who is doing/executing what on a linux host at a point in time. Continuing with some of…

Read More Read More

Iterating Dates On The bash Command Line

Iterating Dates On The bash Command Line

Sometimes I want to run a shell script or command for a series of dates, so I have created a bash library function which takes a start date and an end date, and iterates over the dates passing each date to another command/script. This is moving away from SQL/Database specific content. Much of what I…

Read More Read More

Some Refactoring Solutions For Magic Numbers

Some Refactoring Solutions For Magic Numbers

Today I’m looking at solutions to Magic Numbers. Magic numbers are hard coded numbers (or references) which appear in scripts and procedures, they creep in very easily. I don’t think that magic numbers are entirely bad. If you have a stored procedure which modifies data for a specific customer, having the one customer ID in…

Read More Read More

Replacing Repeated Magic Numbers

Replacing Repeated Magic Numbers

If an ID or reference is used more than once in a process, it’s best to store it in a variable and reference that. This can slow down debugging, but makes a process far more portable. It also reduces the number of magic numbers in a process (or at least times they are defined). I…

Read More Read More