The Bit Bucket

SQL: Finding rows that have changed in T-SQL - CHECKSUM, BINARY_CHECKSUM, HASHBYTES

If you have data in a SQL Server table and you want to know if any of the values in a row have changed, the best way to do that is by using the rowversion data type. (Note: this used to be called the timestamp data type in a rather unfortunate naming choice). I’ll talk more about it in another post.

But today I wanted to discuss the another issue. If I have an incoming row of data (let’s say @Parameter1, @Parameter2, @Parameter3, @Parameter4) and I want to know if the incoming values match the ones already in the table and update the table only if they are different, what’s the best way to do that/

2018-07-02

Book Review: Essentialism - Greg McKeown

Another book that I’ve been listing to lately on Audible is Greg McKeown’s Essentialism: The Disciplined Pursuit of Less.

This was a very timely book for me. I find it very easy to get endlessly bogged down in minutia, rather than just always focusing on the big picture of what I’m doing. It’s really easy to do that if you have a great desire to get things perfect or close to perfect. But that’s not what you should be aiming for.

2018-06-29

Shortcut: The magical F1 key - help on syntax and metadata

I used to always recommend that people install Books Online (BOL) on their systems. It’s ironic that it was called “Online”, given we’re really talking about “Offline” nowadays, but back when we first were talking about it, we were comparing it to a physical book, not to a live reference on the Internet.

Nowadays though, I find that the version online is so far superior to the one that you can install locally, that I think it’s better to just use the online version. I particularly like the way that the online books are now cross-version ie: each page covers all supported versions, instead of having a separate page for each version.

2018-06-28

SDU Tools: Create a linked server to Azure SQL Database from SQL Server

When I need to move small amounts of data between an on-premises SQL Server system and an Azure SQL Database, or run queries that involve both systems, the easiest option at present is to create a linked server to Azure SQL Database.

And the easiest way to do that (or if you can’t remember the commands) is with one of our free SDU Tools for developers and DBAs, called CreateLinkedServerToAzureSQLDatabase. You can read it to check out the code, or use it like this:

2018-06-27

Opinion: Learning to talk to developers - marketing to the right people for SQL Server

Yesterday, I posted about why software houses don’t keep up to date with SQL Server releases. That’s one issue but there’s also a deeper issue. When I saw postings from product group members about this, it was predominantly DBAs that they are talking to.

I think this is targeting entirely the wrong people for this discussion.

For many years now, almost all the discussion from the product group to “customers” seems to have focused on DBAs. These people are often at the end of the chain in many organizations.

2018-06-26

SQL: Why don't software vendors support the latest versions of SQL Server?

There has been quite a bit of discussion online lately about which version of SQL Server new applications should target. Members of the SQL Server product group were saying they can’t see any reason why new applications should use anything less than SQL Server 2016 as a real base line.

I’d love to see any new application using the absolute latest version of SQL Server. Unlike the bad old days where you needed to wait for a service pack before using the product, the best tested version of SQL Server is invariably the one that’s just released. (And there aren’t service packs any more anyway).

2018-06-25

Book Review: Building a Story Brand - Donald Miller

I’ve been reading and/or listening to a lot of books again lately and one that I didn’t have high expectations for, but ended up really liking was Donald Miller’s Building a Story Brand.

If you are a business owner, I’d suggest listening to it or reading it. It takes a really refreshing approach of what he calls using a story brand framework.

When you need to tell someone what your business does, how do you describe that?

2018-06-22

Shortcut: Apply cut or copy commands to blank lines when there is no selection

When I’m doing a lot of query editing, I often get a bit mesmerized, particularly if there’s a lot of manual copy and paste or cut and paste going on.

One thing that often drives me crazy is when I use Ctrl-C (ie: copy) when I meant to use Ctrl-V (ie: paste). Invariably, I do this when I have nothing highlighted at all. So not only did I not get the value pasted, I just copied an empty value into the clipboard.

2018-06-21

SDU Tools: Clear Service Broker Transmission Queue in T-SQL

Service Broker is one of my favorite tools in SQL Server. So many applications need to have a transactional queue, and many people try to build them using tables and other objects. But SQL Server has Service Broker and with it, you get the beauty of using the knowledge of someone who already knows about queues having thought about how they need to work.

But while Service Broker is quite forgiving, it’s common while developing Service Broker applications to make mistakes and end up with messages in queues that will never be delivered because you had some bug in your code. Service Broker doesn’t want to ever just throw your data away.

2018-06-20

Opinion: Design your own job

One of the software houses that I’ve done some work for over the years has had a number of unexpected issues with their clients and had to shed quite a lot of their staff. This is always a concerning time and I’m seeing a lot of worried and unhappy people. Either they don’t think  their jobs will last, or they are upset at having been moved to roles that they don’t want.

2018-06-19