The Bit Bucket

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

SDU Tools: Is a SQL Server Agent Job Running ?

I often need to write scripts that interact with SQL Server Agent jobs. One thing that I regularly need to know is if a particular job is currently running.

In our free SDU Tools for developers and DBAs,  we added a function IsJobRunning to work that out.

You can see the outcome in the main image above.

You can see it in action here:

YouTube Video

2018-10-03

Opinion: What's with the lack of coding standards in Data Science?

I’ve been spending a lot of time over the last few years working through data science and AI topics. One thing that’s struck me consistently is the total lack of reasonable coding standards in almost all the sample code that I see.

I was doing an AI lab in eDX recently, and one of the questions got me to open some sample Python code for a virtual environment, and asked me to work out how the virtual world that it created operated.

2018-10-02

SQL Server Q&A: Does SQL Server have a boolean data type? Is that a bit?

Simple answer: No

SQL Server has a concept of boolean data type but it doesn’t have an actual boolean data type. I can’t declare a column with a boolean data type, and I can’t use it that way. However, the concept of boolean data is present.

For example, if I write the following:

SELECT * FROM Sometable WHERE Somecolumn = Someothercolumn

the outcome of that comparison is TRUE, FALSE, or (don’t forget) NULL. And remember that NULL isn’t a value; it’s the lack of a value. WHERE clauses are satisfied when the value of the predicate is TRUE.

2018-10-01

Book Review: The Rosie Effect - by Graeme Simsion

I mentioned in a previous review about how much I enjoyed The Rosie Project by Graeme Simsion. I couldn’t wait for the sequel to come out and so I eagerly read The Rosie Effect: A Novel as soon as it was released.

The first book introduced us to Don Tillman, working on genetics at a local university and trying to help Rosie find her father. All along, he’s trying to find a wife using scientific principles.

2018-09-28