The Bit Bucket

SDU Tools: Convert a hexadecimal character string to an integer in T-SQL

I mentioned in a previous post about how I sometimes need to work with binary strings in SQL Server using T-SQL.  The literal values are hexadecimal strings. T-SQL doesn’t have a simple function to just convert one of these character-pair strings to an integer.

In our free SDU Tools for developers and DBAs, as well as the HexCharStringToChar function, we added a function HexCharStringToInt to do just this.

You can see the outcome in the main image above.

2018-09-26

Opinion: Passwords are a completely broken concept

For a long time, passwords have troubled me conceptually. I now believe that, as a concept, they are beyond broken. As an industry, we need to do better.

I might well need to do with more identities, passwords, multi-factor authentication options, etc. than the average consumer but I know it’s beyond me to get this right, at least in the way that vendors, financial institutions, and source providers expect me to.

2018-09-25

SQL: Implementing Optimistic Concurrency in SQL Server with RowVersion

It’s common to need to have a way to read a row of data from a table, to be able to modify it, and to then update it back into the table, but only if it hasn’t been changed in the meantime. But we don’t want to lock it in the meantime. That’s the basis of optimistic concurrency. By contrast, pessimistic concurrency would hold locks the whole time. In SQL Server, you should use the rowversion data type to implement optimistic concurrency.

2018-09-24

Book Review: The Case Against Sugar - Gary Taubes

You would have to be hiding under a rock to have missed the current low-carb ways of eating, and particularly the ketogenic thinking about food. Central to much of this thinking though is cutting carbs in general. The hard part about this for most people, is cutting the primary source of carbs and that’s sugar.

If ever there was a leader of the fight against sugar, it’s Gary Taubes. His book The Case Against Sugar is very significant.

2018-09-21

Shortcut: Disable certificate revocation checking to start SSMS faster

If you have ever started SQL Server Management Studio in an isolated environment (ie: one with no external Internet connectivity), you’ll find that it’s slower to start.

That’s because SQL Server uses signed assemblies, and whenever an application with signed assemblies starts, it needs to check whether or not the certificate that they were signed with has been revoked. It’s not good enough to just check if it’s a valid certificate.

2018-09-20

SDU Tools: Convert a hexadecimal character string to a character in T-SQL

On occasions I have to work with binary strings in SQL Server using T-SQL.  The literal values are hexadecimal strings. T-SQL doesn’t have a simple function to just convert one of these character-pair strings to a character.

In our free SDU Tools for developers and DBAs, we added a function HexCharStringToChar to do just this.

You can see the outcome in the main image above.

You can see it in action here:

2018-09-19

Opinion: Start and finish meetings on time - don't wait for stragglers

It’s bad enough today that 90% of all online meetings seem to start with endless “can you all hear me?”, “can you see this?”, “I can hear you but I can’t see it”, “John’s trying to connect but can’t”, etc. etc.

But the one that annoys me most is:

Let’s give it a few more minutes for stragglers to connect in

Why exactly?

This often happened with in-person meetings too but it seems even more prevalent now with online meetings. In both cases, it’s inappropriate.

2018-09-18

SQL: Should we use schemas other than dbo in SQL Server databases? (Part 2)

In a recent post, I described the first reason why I think you should be using schemas apart from dbo in your SQL Server database designs. It was to provide a form of grouping like you use with files in your filesystem, and to avoid prefixes. Now we need to talk about the second main reason for using schemas.

Security Boundary

I need to start by saying that if you’re idea of database design and access is to have an ORM that builds queries on the fly and needs access to the entire database without any form of security control apart from what your application provides, you might as well stop reading this post here.

2018-09-17

Book Review: The Rosie Project : A Novel - by Graeme Simsion

One of my continuing projects is to run a series of podcasts with people that I think are interesting in some way, from the data community. I tend to do them in bursts, normally when there’s a new version of SQL Server coming. (I’m about to publish a series of SQL Server 2019 podcasts). One person that I interviewed early on though was Graeme Simsion. You can find the podcast here. It was show 10 back in December 2005. Graeme was a well-known Data Modeler.

2018-09-14

Shortcut: Using Activity Monitor in SQL Server Management Studio

This is a quick tip but an important one. I see many people using SQL Server Management Studio (SSMS) and they aren’t aware of Activity Monitor.

While there are many clever things that we can do with queries, to interrogate the health of the system, don’t forget that there is quite a bit of useful information in Activity Monitor, and it’s easy to get to.

There are two basic ways to launch Activity Monitor. The first is to right-click the server in Object Explorer:

2018-09-13