The Bit Bucket

Opinion: Can your staff avoid customer problems?

I deal with a lot of different service providers, and something that really sets the good ones apart, is their ability to avoid customer issues.

Can your staff avoid customer issues?

Awesome image by Holger Link

Years back, I used to deal with our largest national airline, QANTAS, a lot. They were actually pretty good at helping you out once you had a problem, if you had status with them. What they were extremely poor at, was avoiding issues in the first place.

2019-09-17

SQL: Been told you can't access master database system views in Azure SQL Database? Not true!

When you work with Azure SQL Database, you’ll quickly learn that you send queries to a single database, and you can’t execute USE statements to change to another database. Importantly, you also can’t use four-part names to access objects in other databases like this:

ServerName.DatabaseName.SchemaName.ObjectName

So it’s not surprising that when I’ve been reading some questions in Stack Overflow, asking how on earth you can join the list of users in your database, to the list of logins in the master database. And less surprising that the answer normally is that you can’t do that, and you need to connect to each separately. However, that’s not true. You can get to them using external tables. Let me show you how:

2019-09-17

T-SQL 101: 35 What do we mean by data types in SQL Server?

When you store data in a database,  individual values are stored in columns. Now columns have 2 basic characteristics:

  • Data type
  • Nullability

Another common characteristic is:

  • Size (can be maximum length, precision, scale, etc.)

The first of these, the data type of the column, determines what types of value can be stored in the column. For example, I might have an email address and I might decide that that is a string of characters, but I might also have a price and might decide that that needs to be a number of some type.

2019-09-16

Snowflake for SQL Server users - Part 6 - Role Based Security

Security in Snowflake is quite different to what’s implemented in SQL Server.

In SQL Server, objects have owners that can either be specific people, or as occurs when a dbo person creates an object, it is owned by the dbo role. In Snowflake, objects in the database also have owners, but the owners can’t be users, they are always roles.

When you create a database, there are four pre-defined roles:

2019-09-13

SQL: Lack of consistency in development says so much about your team

I wrote last week about how I don’t like unnecessary abbreviations. It’s all part of a desire to see higher quality code, because that costs less to maintain and support.

Another key issue that troubles me in development is when I see inconsistency.

Single Brain

When you have a team of people doing work, you need to endlessly try to make the outcome look like it’s come from a single brain. And equally importantly, make it look like it’s come from a single brain that cares about quality and attention to detail.

2019-09-12

SDU Tools: Check if an IP address is valid using T-SQL

Every now and again, I need to store IP address values in T-SQL and I want to check if the string that I’m passed is a valid IP address. So, in our free SDU Tools for developers and DBAs, we added a simple tool that works that out. It’s called IsIPv4Address.

You can tell by the name that it only works with IPv4 addresses, not IPv6.

Nothing complex. It takes a string, checks the format, and the range of octet values, and returns its verdict.

2019-09-11

Opinion: Start meetings ontime - "give it a few minutes" is rude to other attendees

I attend a lot of online meetings nowadays, and I can’t tell you how often at meeting that starts at 10 AM actually ends up starting at 10:05 AM or 10:10 AM to cater for people who are running late. Right now I’m in yet another meeting that hasn’t started yet, as we’re just “giving it a few minutes for stragglers to join”.

Now it’s a different story if there is a specific person who really is needed in the meeting, and they’ve let you know they are running a few minutes late. But I see this as routine in pretty much every meeting I attend. Meetings almost never start at the correct time.

2019-09-10

T-SQL 101: 34 Formatting your scripts for readability

While it might be obvious that it’s important to format your T-SQL code for readability, it might be less obvious that there’s no agreed standard for how to format that code.

Everybody has their own style. The main thing. People will tell you all the time is just to be consistent. But then they’ll tell you they don’t like the format you’ve used.

Take a reasonable style and then to just keep applying it.

2019-09-09

Snowflake for SQL Server users - Part 5 - Editions and Security Features

Like most products, Snowflake comes in a number of editions, and you can see the current editions in the main image above. (Keep in mind that they could always change at any time and to check their site for the current options).

First thing I need to say is that I really like the way that most of the SQL code surface is pretty much identical across editions. I wish that was complete coverage but it currently doesn’t include materialized views.

2019-09-06

SQL: Try to avoid unnecessary abbreviations when naming objects

There’s an old joke in computing about how you can spend 90% of the time on a project working out what to name things, and end up without time for doing the work.

Phil Karlton is credited with having said: There are only two hard problems in Computer Science: cache invalidation and naming things.

I really liked Jeff Atwood’s or Leon Bambrick’s update though: There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors. (Can’t work out who said it first).

2019-09-05