The Bit Bucket

SDU Tools: List Incoming Foreign Keys in a SQL Server Database

One of the challenges when you have foreign keys in place, is that there are restrictions on what you can do to tables that are the targets of the foreign keys. What’s often needed though is a list of all references to a particular table or set of tables.

In our free SDU Tools for developers and DBAs,  we added a function ListIncomingForeignKeys to do just that, and to provide their details in a form that’s easy to consume programmatically if you need that.

2018-10-31

Opinion: Design the Business Model, not just the App

I posted the other day about how the pricing of apps has become silly. Most apps are priced so low that there really isn’t much income but worse, most don’t have a business model for the authors.

I’m sure that many smartphone app developers just think they can offer an app and get a bunch of money in quickly. They don’t seem to have thought about what happens beyond that point.

2018-10-30

SQL: What is REFERENCES permission and why does it matter?

I was at a client site the other day and they were puzzled by SQL Server object permissions. In particular, they couldn’t understand what the point of the REFERENCES permission is. It seemed pointless to them. It’s not. Let me explain why.

Keep in mind that if all the objects in the database have the same owner, then this isn’t an issue. But not all databases are like that. Many have different teams that control different parts of a large database.

2018-10-29

Book Review: 1984 - George Orwell

One of the things that using Audible has let me do lately is to get through additional books that I’m interested in. Part of that has been to go back through real classics. They don’t come more classic than 1984 by George Orwell.

When I was at high school, this was one of Orwell’s books that I read. Listening to it again now though, two things struck me:

  • How much I’d forgotten of the detail in it
  • How chillingly relevant it is today

The first two chapters in particular had me simply amazed at how prescient Orwell was. So many aspects of what he described that were clearly intended to be horrific and unthinkable at the time, and yet are so close to the current reality in many places that it’s quite chilling to listen to.

2018-10-26

Shortcut: Configuring registered servers in SQL Server Management Studio

When working with SQL Server systems, it can be hard to remember the names of all the servers, to remember connection details for the ones that need SQL logins (instead of Windows authentication), and to remember other details of those servers, such as which environments they are part of (eg: production, UAT, test)

SQL Server Management Studio (SSMS) has a facility to help you to do this. It allows you to register server details in a single place.

2018-10-25

SDU Tools: List Foreign Key Columns in a SQL Server Database

In a previous post, I talked about the ListForeignKeys procedure as part of our free SDU Tools for developers and DBAs. That procedure returned one row per foreign key. Sometimes though, you need to process each column of a foreign key separately. So we’ve provided the ListForeignKeyColumns tool to do that.

The tool also detects any keys that are using system-generated names. (We don’t recommend that).

You can see how to execute it in the main image above. The procedure takes these parameters:

2018-10-24

Opinion: Just how cheap should applications be?

In a recent post, I talked about my use of SnagIt and how I think people should be prepared to pay a little for applications. I’m endlessly puzzled by people I see stumbling around using free alternatives that don’t do the job, when there are good options available.

I had some interesting feedback from that post and it got me thinking further though, about how much we should be prepared to pay for applications? Why is there an expectation that most apps that we use will be free?

2018-10-23

SQL: SET NOCOUNT ON in SQL Server Triggers

I’ve done a lot of Microsoft certification exams over the years. Most of those have been SQL Server exams. The quality of the questions in those exams though, varies enormously.

One of the exams that really drove me crazy a while back was one of the intro-level ones. The problem was with the number of errors in the exam. When the question-writer gives you five substantial blocks of T-SQL, and asks which one is correct, yet they are all actually wrong in some way, that makes it a very, very tough question to answer. I find these types of exams very tiring because I’m endlessly trying to second guess what the question writer actually meant to ask. Some exams have a large number of these.

2018-10-22

AI: Machine Learning and AI - What's in a name?

I regularly hear the terms AI and Machine Learning used almost interchangeably, along with a variety of other related terms. I thought it would be useful to add a post that defines some of the common terms and how they differ:

Artificial intelligence (AI) is a fairly generic term. It relates to all intelligent agents that are able to be aware of their environments (in some way), and to take actions where the aim is to achieve a specified goal. Sometimes these goals are terminal ie: they reach a final desired state. Other times, these goals are continuous ie: keep speed at a desired value. It is considered “artificial” intelligence as to an observer, it mimics cognitive functions that humans would imagine other humans performing.

2018-10-19

Shortcut: Finding error locations within queries in SQL Server Management Studio

This is probably one of the simplest tips that I’ve published, yet I’m endlessly surprised how many people do not realize that it’s available.

When you have a script loaded in SQL Server Management Studio (SSMS), and you execute the script, you might run into an error like this:

To find where the error is, just double-click the error down in the Messages tab. I double-clicked it, and it took me directly to the error and highlighted it:

2018-10-18