The Bit Bucket

SDU Tools: List Foreign Keys in a SQL Server Database

In SQL Server Management Studio, there’s no great way to list all the foreign keys that are defined in a database.

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

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

2018-10-17

Opinion: Shout out to TechSmith for Snagit

I don’t normally do blog posts to just promote products from companies, but two weeks ago I was asked about tools that I use on a daily basis and that I really wouldn’t want to do without. Normally with a question like that, I have to think for a while. But this one’s easy: It’s SnagIt from TechSmith.

It’s the one tool that I use in nearly every part of my work. I use it all day long. If I didn’t have it, it would harm my productivity in a significant way.

2018-10-16

SQL: Version 12 of SDU Tools has shipped

SDU Tools is a toolkit that’s simple to use, has many useful functions, procedures, and views, and is updated regularly. Even if you aren’t using the tools as a set, they provide wonderful examples of how to do things in T-SQL. We have released version 12.0 of these popular tools.

The tools are free tools for DBAS and Developers. Tools for comparing databases, tables, finding unused indexes, manipulating strings, performance tuning converting data, and so much more.

2018-10-15

AI: Detecting and Avoiding Customer Churn is Critical

I’ve flown a lot over the years. What continues to strike me though, is how poorly airlines use machine learning and AI, even when they are in strong competitive environments. A key indicator is detecting and avoiding customer churn. Let me give you an example:

We flew with QANTAS and with their partners in One World for many years. We were both platinum and I’d been platinum for many years. At a recent peak a few years ago, we were flying once or twice a week. That’s not a crazy amount, but it’s enough. And it’s certainly enough to be able to see a purchasing pattern.

2018-10-12

Shortcut: Change the number of rows selected or edited in Object Explorer in SSMS

When you right-click a table in SQL Server Management Studio, you get options for selecting or editing but the number of rows is limited:

Those values can be changed. By default, these numbers are both 200, but I’ve decided to change the default number of rows selected to 1000.

In Tools, Options, SQL Server Object Explorer, then Commands, you can set the values to whatever suits you:

I don’t tend to ever use the Edit option but I’d suggest not making it too large.

2018-10-11

SDU Tools: Is XACT_ABORT on in my SQL Server session?

XACT_ABORT is one of the least well understood options that you can configure in a SQL Server session. Yet it’s very important. XACT_ABORT makes statement-terminating errors become batch-terminating errors. Without it, even within a transaction, many errors only terminate the statement that they occur in, and control passes to the next statement within the transaction, not out of the transaction.

In nearly every stored procedure that I write, the template includes the following lines:

2018-10-10

Opinion: Why penguins don't explode and the need for basic research

When government funding is tight, it gets harder and harder to get grants to perform fundamental research. The government always wants to see outcomes, and this means that the grants committees need to show outcomes. In turn, this often leads to research funding bodies doing one of three things:

  • Only funding research that’s nearly complete
  • Only funding well-known researchers with a track record of outcomes
  • Only funding research in areas that are already showing promise

Now while at first glance, that might sound a reasonable way to proceed, it’s not.

2018-10-09

SQL Server Indexing for Developers - new online on-demand training course

Do you need to understand SQL Server indexing in detail? Do you know someone else who needs to? Either way, our new SQL Server Indexing for Developers course could be just what you’re looking for.

It’s detailed. It has a full set of practical exercises (hands-on labs) with downloadable test data and scripts.

The best part is it’s on sale until October 31st for $195 USD as an introductory special.

2018-10-08

Book Review: The 7 Habits of Highly Effective People

While continuing on the path of listening to many older but classic books, I had to include The 7 Habits of Highly Effective People by Stephen R Covey.

I remember first reading this book shortly after it was released. I note that the version I listened to in Audible recently was the 25th anniversary edition. I’d say it’s stood the test of time pretty well. An enormous number of copies (over 25 million) have apparently been sold over those years.

2018-10-05

Shortcut: XML editor in SSMS and increasing XML output size

Most people use SQL Server Management Studio (SSMS) to edit SQL queries. No big surprise there. The files will have a file type of .sql.

But what many people don’t understand is that SSMS inherits many of its underlying Visual Studio’s abilities to edit other document types.

For example, if you open a .txt text file, you can edit it just fine, and you can also include files like this in SSMS script projects. That can be useful for additional notes and documentation.

2018-10-04