The Bit Bucket

T-SQL 101: 11 The Basic Syntax of a T-SQL SELECT Statement

The most basic form of SELECT statement that we used to get information out of a table is the word SELECT followed by a list of columns or expressions that we want, and then details of where we need to get them from. Typically, that’s a table.

The basic syntax of a SELECT statement in SQL Server T-SQL is as follows:

Committees are curious things, and I can’t say that I always agree with their outcomes. I suspect if I’d been designing this, I would have had:

2019-04-01

SDU Podcast: Jakub Szymaszek on SQL Server 2019 Always Encrypted with Secure Enclaves

Yesterday I had the pleasure of recording another new podcast on a SQL Server 2019 topic. Jakub Szymaszek is a PM on the SQL Server team, working around security.

In this podcast, Jakub and I discussed the current state of security and encryption in SQL Server, starting from cell-level encryption (CLE) and transparent database encryption (TDE) in SQL Server 2005. We then discussed the introduction of Always Encrypted and Data Masking in SQL Server 2016.

2019-03-30

SQL: Our new SQL Server Replication online training course is now available

We’re really excited that our latest online on-demand course is available. If you’ve ever wanted to get comfortable with SQL Server Replication, now’s the time to do it, from the comfort of your own place, and at your own pace.

The course Working with SQL Server Replication is being released at just $195 USD, but for my readers, there’s an extra special offer: Use coupon code REPLAPR19 to get another 25% off, but just till Apr 13.

2019-03-30

SQL: Is REPLICATE in SQL Server not replicating enough?

Even though I’ve worked with SQL Server for what feels like forever, I still constantly trick myself up with T-SQL commands that give me output that’s different to what I was expecting. This week, it was REPLICATE.

What should the output of the following statement be?

SELECT REPLICATE(‘Hello’, 10000);

If you said the word Hello repeated 10,000 times, or didn’t know at all, read on.

The clue comes if I execute the following statement:

2019-03-29

SDU Tools: Show Current Blocking in SQL Server

Blocking is a popular topic in SQL Server. Users are often trying to work out what’s blocking what. In our free SDU Tools for developers and DBAs, we have a tool to make that very easy to see. It’s called ShowCurrentBlocking.

ShowCurrentBlocking takes one following parameter:

@DatabaseName (sysname) is the database to report on

It returns two sets of data.

The first rowset is a list of all objects that are currently blocked, and the last query that was run on the connection for each of those objects.

2019-03-28

FIX: Headset volume too low on Windows 10 (LX-3000)

After some recent upgrade to Windows 10, I’ve found that the headphone volume is way too low for me. I’m using Microsoft LX-3000 headsets, and have always really liked them.

So I was really puzzled what makes the volume so low.

The thing that’s made the biggest difference for me is to enable loudness equalization in the properties of the device. For those that aren’t sure how to do that, here’s a quick set of screen shots:

2019-03-27

Opinion: Another plea to developers - please avoid fixed size windows

Just thought I’d send another plea out to my developer friends:

Please stop making windows fixed size when they don’t need to be.

Take a look at the main image above. The issue isn’t just this one application, it’s a plague. The window:

  • Is fairly small
  • Is way smaller than the desktop space
  • Has no resizing handles
  • Is not able to be maximized
  • Has content that doesn’t fit in the current window size

Why?

2019-03-27

T-SQL 101: 10 What are Schemas in SQL Server?

In the last post, when talking about querying a table, I mentioned that you should always include the name of the schema when you refer to a table. This is called using two-part names. But what are schemas in the first place?

In different database engines (e.g. Oracle, PostgreSQL, etc.), schemas are implemented and work differently i.e. there isn’t a consistent story across the industry. In SQL Server though, the closest analogy that most people would be familiar with, is a folder where you group things that are related in some way.

2019-03-25

Book Review: Alibaba - The House that Jack Ma Built

You probably already know that I’ve been learning Mandarin for about 8 years now, and have a fascination with Chinese business and technology. Learning the language has made this more approachable for me.  The story of Jack Ma and Alibaba is one of the really interesting aspects of Chinese business today, so I was intrigued to read this book:

Alibaba: The House that Jack Ma Built by Duncan Hall

I ended up listening to the book via Audible rather than reading it.

2019-03-22

SQL: Why is SQL Server Configuration Manager missing?

Ever since it appeared back in earlier versions of SQL Server, I’ve normally launched SQL Server Configuration Manager from the Start menu in Windows. But every now and then, with some versions, it seemed to disappear. Now with the latest version of SQL Server installed on the latest version of Windows, it’s not there at all.

While it is possible to put it back in the menu, I think it’s time for us to get used to starting it in a different way.

2019-03-21