Problems displaying this newsletter? View online.
Database Weekly
The Complete Weekly Roundup of SQL Server News by SQLServerCentral.com
Hand-picked content to sharpen your professional edge
Editorial
 

A Lack of Error Handling

I saw a post by Brent Ozar the other day, and it was a bit disturbing to me. A survey he posted on Twitter showed most people don't bother with error handling in T-SQL. I'm not surprised, though I wonder if people think about the "rare" as including all the one single statement queries they write. I certainly don't expect error handling for simple queries when they are a single statement used to return data to a client.

However, in stored procedures and multi-statement batches, I see the same thing as the results Brent published. Very little error handling. I've tried in my demos to add it and be sure that I set a good example, even though most of the time I'm showing code that just always works. I know what data I'll enter for a demo, and I don't run into issues.

Many years ago, decades actually, when I was in college and early in my career, I saw many application software packages written without a lot of error handling. This included C/C++ at the time, which seems crazy. In the last decade, I've seen a lot more robust error handling (and testing) added to the work of many application developers. It's the request that my professors and more than a few bosses always made, but in the late 80s/early 90s, few people actually followed through with. In the 2010s, this seems to be more common, and not surprisingly, software quality has improved.

In many ways, database developers are less mature than application software developers in many ways. Less error handling, less automated testing, and that's understandable. We haven't had great tools or patterns to help us easily adopt these practices as a habit. In addition, the way in which code is compiled and then executed doesn't make this easy for us. The platform and structure of the language create complexity that isn't present in application languages.

If you haven't written this in the past, as Brent notes, there's not need to worry about going back now. Either your code is working or not working, and if it's the former, no reason to revisit it. However, I might ask that you experiment with error handling for new code. Learn how to use these structures to protect against your users entering strange data. Something they are likely to do.

Steve Jones - SSC Editor

Join the debate, and respond to the editorial on the forums

 
The Weekly News
All the headlines and interesting SQL Server information that we've collected over the past week, and sometimes even a few repeats if we think they fit.
Vendors/3rd Party Products

One Flyway Migration Script for Diverse Database Systems

How to create a single set of SQL migration scripts for Flyway that we can use across multiple database systems, or for all regional variants of a database.

Discovering What’s Changed by Flyway Migrations

A set of PowerShell cmdlets that will 'diff' two versions of a database and provide a high-level overview of the major database changes made by successive Flyway migrations. You can 'diff' a SQL Server database to the same one on PostgreSQL and find out which objects are the same and which are different.

AI/Machine Learning/Cognitive Services

Overcoming AI bias to empower an equitable society

From AllAnalytics

Reasoning frameworks of artificial intelligence used in criminal justice and health care systems move us to rethink how AI can be constructed to help foster an equitable society.  We...

AIOps Benefits All Aspects of the Enterprise

From IT Pro - Microsoft Windows Information, Solutions, Tools

We unpack what you need to know about artificial intelligence for IT operations and how AIOps benefits multiple parties in enterprise IT.

Using AI to Scale Spear Phishing

From Schneier on Security

The problem with spear phishing is that it takes t...

AutoML in Azure Machine Learning for Regression and Time Series

From SQLShack

Introduction AutoML in Azure Machine Learning is used to build machine learning models on its own as we discussed in the previous article. Over there, we discussed what AutoML...

Administration of SQL Server

Understanding Instant File Initialization after enabling TDE (Transparent Data Encryption) on SQL Server databases

From SQLShack

SQL Server Transparent Data Encryption (TDE) enables encryption on database files to secure its databases. Enabling TDE might have some adverse effects on your database system or on some...

Checking SQL Server Start Time

From Callihan Data

When you are troubleshooting query performance, it’s important to consider when SQL Server last restarted. Each time SQL Server restarts, buffer pool and plan cache get wiped out. This...

Finding Failed Job Steps

From SQLServerCentral Blogs

Kendra’s query was a good starting point, and I used most of it in the first CTE shown below. This query basically looks at msdb.dbo.sysjobhistory and msdb.dbo.sysjobactivity, joining them... The...

Logging in with DAC in SSMS

From Callihan Data

Have you heard of SQL Server’s dedicated administrator connection? The dedicated administrator connection (DAC) can come in handy in an emergency scenario so you should have it enabled and...

Stored Procedure to Get Indexes Status in All Databases

From SQL Server – {coding}Sight

As SQL Server DBAs, we’ve heard that index structures can dramatically improve the performance of any given query (or set of queries). Still, there are certain details that many...

Analysis Services / BI on the MS Stack

Costs – Part 10 | Migrating from AAS to PPU

From FourMoo

One of the most important aspects when looking to migrate from AAS to PPU is what will costs be. This plays an important part in the decision. In this blog post instead of doing an AAS and PPU comparison I am going to do this side by side, which I feel will make it easier to compare.

Azure Databricks, Spark and Snowflake

What is the difference between RDD, Dataframe and Dataset in Spark?

RDD, Dataframe and Dataset are all Spark APIs introduced in Spark at different points in time. The goal of these API is to help us work with large datasets in a distributed fashion in Spark with performance in mind.

Creating functions in Kusto Queries

In the previous blog, I illustrated how to create sub-queries in Kusto. However, sometimes we may face even more complex situations and we may need to create not only a sub-query, but a function.

Azure SQL Database

Configure the Max Degree of Parallelism (MAXDOP) in Azure SQL Database

From SQLShack

This article explores the Maximum Degree Of Parallelism (MAXDOP) for the Azure SQL Database. Introduction A DBA needs to do proactive monitoring, troubleshooting, and work on optimizing your query...

Azure Synapse (SQL Data Warehouse and Data Lake)

Azure Data Lake ACL Introduction

Access Control Lists (ACLs) offer low-level control of access to the folders within your Azure Data Lake, whilst Role-Based Access Control (RBAC) offers high-level control to the entire lake.

Exploring The Data Lake Curated Zone

From BlueGranite Blog

When you jump into a data lake, you’ll find that if properly designed, it will be split into designated zones. Each zone has a mission to fulfill that justifies...

Career Growth and Certifications

Trending Tech to Watch: What Is Hybrid IT?

From IT Pro - Microsoft Windows Information, Solutions, Tools

Companies asking “What is hybrid IT?” may be actually implementing it. Here’s how to take a strategic approach.

Sharing knowledge in communities of practice

From Simple Talk

Communities of practice bring people together to share ideas and learn from each other about a common interest. In this article, Robert Sheldon explains and gives some advice on...

Community Interests

A Post-mortem for PASS, and What That NDA* Issue Was

From The SQL Herald (Joey D'Antoni)

Editor’s Note: I wrote this last December, and went back and forth on publishing. As I see some of the poor leadership patterns from PASS, creeping into new offshoots...

Computing in the Cloud (Azure, Google, AWS)

How to change the slow query log threshold on RDS

Before we discuss how to change the slow query log threshold on RDS, let’s quickly establish what the slow query log is.

Three Mistakes That Will Ruin Your Multi-Cloud Project (and How to Avoid Them)

From Dataversity

Click to learn more about author Keith Neilson. Multi-cloud is positioned to take over this year, as over 90% of enterprises worldwide are expected to depend on a blend...

Filtering data in Azure Database for PostgreSQL

From SQLShack

In this article, we will go over some of the most fundamental ways to filter data hosted in PostgreSQL. Introduction Data is hosted in a variety of data repositories,...

Scaling down in the cloud

From SQLServerCentral Blogs

I may be completely off base here, but I’ve noticed a correlation between folks who use Amazon Web Services and their understanding that once you scale up a service... The...

Conferences, Classes, Events, and Webinars

Donovan Brown & Mark Fussell talk Cloud Native development with Dapr

Join Donovan Brown, Partner Program Manager, and Mark Fussell, Lead Program Manager from the Azure CTO Incubations team at Microsoft as they talk all things modern Cloud Native development with Dapr.

Estate monitoring for your growing data environment

Join Grant Fritchey and database professionals from WestJet, Fiducia Gad and Richemont to learn how effective estate monitoring enables them to manage continually evolving environments, and intensifying data demands.

Mark Your Calendars: Free Live SQL Server Training Classes in October & November.

From Brent Ozar Unlimited

This fall, I’m going to teach you the fundamentals of Microsoft database performance tuning, live, for free. The first class is my How to Think Like the Engine class....

DMO/SMO/Powershell

Fun With PowerShell Code Formatting

From Arcane Code

Fun With PowerShell Code Formatting

Data Mining / Data Analysis

exploring data is different than explaining data

From Storytelling with Data

Today’s quick makeover post was inspired by a discussion in a recent client workshop. At the beginning of our sessions, we ask attendees to share what they want to...

4 ways analytics are enhancing sports

From AllAnalytics

When people think about sports, many things may come to mind: Screaming fans, the intensity of the game and maybe even the food. Data doesn’t usually make the list....

Data Privacy, Compliance, and GDPR

2021 Data Protection Report

From IT Pro - Microsoft Windows Information, Solutions, Tools

Data protection, now more than ever, is providing peace of mind while helping you ensure business continuity. The world of data protection is wide and varying, across new technology and...

Data Visualisation

CDOT Bar Chart Makeover

From SQLServerCentral Blogs

As I was browsing Twitter today, I noticed a tweet from the Colorado Department of Transportation about their anti-DUI campaign. Shown below, it contains a bar chart that appears... The...

ETL/SSIS/Azure Data Factory/Biml

Azure Test Plans example for Azure Data Factory

From Kevin Chant

Reading Time: 4 minutes In this post I want to cover an Azure Test Plans example for Azure Data Factory as part of a series of posts. For...

Hardware

SanDisk Extreme PRO and Crucial X6 4TB Portable SSDs Review: Contrasting High-Capacity Storage Options

From AnAndTech

The portable SSD market has been steadily expanding thanks to the increasing digital footprint of consumers. Technological advancements such as 3D NAND with high layer counts and the emergence...

Intel’s Arc GPUs will compete with GeForce and Radeon in early 2022

From Ars Technica

"Alchemist" will be Intel's first serious dedicated gaming GPU.

MDX/DAX

ADDMISSINGITEMS – DAX Guide

From SQLBI

ADDMISSINGITEMS: Add the rows with empty measure values back. https://dax.guide/addmissingitems/

Using CONTAINS in DAX

From Sqlbi

This article explains how the CONTAINS function works and what can be used as better alternatives in DAX in common use cases. The CONTAINS function in DAX has been...

GENERATE, GENERATEALL – DAX Guide

From SQLBI

GENERATE: The second table expression will be evaluated for each row in the first table. Returns the crossjoin of the first table with these results. https://dax.guide/generate/ GENERATEALL: The second...

Microsoft News

Microsoft Invests in Rubrik, Partners to Protect Customers from Ransomware

From IT Pro - Microsoft Windows Information, Solutions, Tools

Microsoft is investing in software startup Rubrik and the two companies will combine on products that will help customers hit by ransomware recover their critical data without paying hackers.

Performance Tuning SQL Server

Finding Queries With Multiple Plans In Query Store

From Erik Darling Data

Cached Out There are lots of examples of how to do...

You Probably Shouldn’t Index Your Temp Tables.

From Brent Ozar Unlimited

When you’ve got a process that uses temp tables, and you want to speed it up, it can be tempting to index the temp table to help work get...

Finding problematic NOLOCK patterns – Part 3

From SQLBlog.org

In part 3, I tie it together and show how to use relational logic to further eliminate false positives.

Introduction to SQL Server Filtered Indexes

From SQLShack

This article intends to give information about the SQL Server filtered indexes and their performance impacts. Introduction Indexes are the special data structures that help to improve the performance...

Experiment: Does sp_recompile on a table update associated views.

From SQLStudies

tldr: No. You have to use sp_refreshview. One of the only good things to come out of all of the ... Continue reading

Dealing With Unparameterized IN Clauses From Entity Framework

From Erik Darling Data

Seriously If you’re using Entity Framework, and sending in queries that build up IN clauses, they won’t end up getting parameterized. Even Forced Parameterization won’t help you if you’re...

PowerPivot/PowerQuery/PowerBI

Rename Many Columns at Once in Power BI

From Excelerator BI

This is not the first time I have shared this concept.  In my previous article I showed how it is possible to add a prefix to every column in...

3 signs it’s time to OPTIMIZE your Power BI report

From Guy in a Cube

There are 3 signs that we look for to help tell us...

(Livestream Replay) Design Thought Process for Power BI Reporting - with Miguel Myers

From Havens Consulting

ABSTRACT ?? Visualizing large amounts of data can be overwhelming and frustrating regardless of one’s skill level, so imagine how frustrated and exhausted the viewing audience can become when...

Power BI Push Tools

From SQLBI

Power BI Push Tools is a set of open-source tools to work with Power BI push datasets. Read Implementing real-time updates in Power BI using push datasets instead of...

Can you refresh a single table in Power BI?

From Guy in a Cube

Frustrated that a you can only do a full refresh? ...

POWER BI GOALS AND OKRS

Using Power BI Goals to manage Objective and Key Results (OKRs) are a great way to keep your remote and hybrid employees in sync with minimal overhead. The OKR technique enables you to create clear behavior targets for groups and individuals that are tied to underlying activities and data.

Part 5: Bringing DataOps to Power BI

Let’s Orchestrate… If you have read Part 3 and Part 4 of this series, you’ve probably noticed that I was building towards something. By combining the best practices in version control and the best practices in testing, you can start to automate the building and testing of Power BI reports/datasets.

Analyzing Breakdowns Between Two Categories with a Waterfall Chart

Learn a unique way to utilize a waterfall by restricting its categorical comparison to just two values, with a breakdown comparison between. By combining a slicer and a bit of DAX magic in Power BI.

How Defining Too Many Measures In A Live Connection Report Can Affect Power BI Query Performance

From Chris Webb's BI Blog

You probably know that it’s a best practice to build your Power BI datasets in a separate .pbix file from your reports – among other things it means that...

Product Reviews and Articles

Dealing with Failed SQL Migrations in MariaDB or MySQL

From Product learning – Redgate Software

This article explains the fastest ways to restore the previous version of the database, to recover from a failed Flyway migration that leaves the database in an indeterminate state,...

Flyway with MariaDB for Those of a Nervous Disposition

From Product learning – Redgate Software

This article will get you up and running quickly with Flyway migrations on MariaDB or MySQL databases, from PowerShell. The post Flyway with MariaDB for Those of a Nervous Disposition...

Product Upgrades and Releases

SQL Server 3rd Party Backend for Django v1.0 Released

From MS SQL Server Blog

We're officially announcing the release of mssql-django v1.0 as an open source project!   At Microsoft we've heard from the community loud and clear - SQL Server is the biggest enterprise...

New – Amazon EC2 M6i Instances Powered by the Latest-Generation Intel Xeon Scalable Processors

From AWS News Blog

Last year, we introduced the sixth generation of EC2 instances powered by AWS-designed Graviton2 processors. We’re now expanding our sixth-generation offerings to include x86-based instances, delivering price/performance benefits for workloads...

Python

Predicting When Your SQL Server Will Run Out Of Space via Colab, Plotly, and Pandas

No, not Azure Data Studio or Databricks notebooks (yet) – I wanted to give Google Colab a spin and the big G hosted Jupyter notebook has an expansive free tier with more RAM than my work computer and a graphics card attached to boot!

Reference equality for dictionaries in Python

From Ayende @ Rahien

Implementing a unit of work in Python can be an interesting challenge. Consider the following code: This is about as simple a code as possible, to associate a tag to...

R Language

Using R and Microsoft SQL Server to run prediction model with API call

From TomazTsql

From the previous two blog posts: Creating REST API for reading data from Microsoft SQL Server in web browser Writing DAta to Microsoft SQL Server from web browser using...

Learning Path for “Data Science with R” – Part I

From Learning Machines

Over the course of the last two and a half years, ...

SQL Server Security and Auditing

T-Mobile has been hacked yet again—but still doesn’t know what was taken

From Ars Technica

Data reportedly includes SSNs, driver's license numbers, and more for 100 million people.

Security News and Issues

T-Mobile Data Breach

From Schneier on Security

It’s a big one: As first reported by Motherboard on Sunday, someone on the dark web claims to have obtained the data of 100 million from T-Mobile’s servers and is...

Troubling New Disk-Level Encryption Ransomware Surfaces

From IT Pro - Microsoft Windows Information, Solutions, Tools

'DeepBlueMagic' also deletes Volume Shadow copy for Windows, making recovery all but impossible without a decryption key.

Critical Vulnerability Affects Millions of IoT Devices

From IT Pro - Microsoft Windows Information, Solutions, Tools

CISA, Mandiant, and ThroughTek share the details of a vulnerability that could allow attackers to observe camera feeds and remotely control devices.

Apple’s NeuralHash Algorithm Has Been Reverse-Engineered

From Schneier on Security

Apple’s NeuralHash algorithm — the one it’s using for client-side scanning on the iPhone — has been reverse-engineered. Turns out it was already in iOS 14.3, and someone noticed: Early tests...

Software Development

Introduction to event-driven architecture

Everything in an event-driven architecture centers around the event. Put simply, an event is anything interesting that happens in your application. Events at all levels of your application, from the end-user client level down to the network connectivity level, may be noteworthy.

Writing data to Microsoft SQL Server from web browser using REST API and Node.js

From TomazTsql

In previous blog post Creating REST API for reading data from Microsoft SQL Server in web browser we have looked into creating REST API calls for reading data from...

T-SQL

Most T-SQL Queries Don’t Even Try to Handle Errors.

From Brent Ozar Unlimited

David Tovee asked a great question in yesterday’s Mastering Query Tuning class. He asked his fellow students, “How many of you actually use TRY/CATCH?” I turned it into a...

STRING_SPLIT is to be used with what?

My friends! Last time together, we discussed using the STRING_SPLIT function and how it’s used in combination with the CROSS APPLY.

Cumulative Distribution Function (CDF) – Analyzing the Roll of Dice with TSQL

From Steve Stedman

After the last post on Cumulative Distribution Function (CDF) or as it is known in TSQL CUME_DIST(), I realized that although I showed how to use it, I didn’t...

STRING_SPLIT is to be used with what?

From Sherpa of Data

My friends! Last time together, we discussed using...

Manage Transaction Concurrency Using Locks in SQL Server

From SQL Server – {coding}Sight

In a multi-user environment, it is essential to maintain truncation concurrency. These locks are in-memory structures of 96 bytes in size. Their role is to maintain data integrity, consistency,...

Divide the rows in equals batches

From SQLServerCentral Blogs

Here is the simple and practical use case of NTILE function. We’ve used it to divide the rows of sys.columns into N batches. N is the batch size. We’ve... The...

SQL Server User-defined Functions

From SQL Server – {coding}Sight

User-defined functions in SQL Server (UDFs) are key objects that each developer should be aware of. Although they are very useful in many scenarios (WHERE clauses, computed columns, and...

Tech News

Google is killing Android Auto for phones (if you even know what that is)

From Ars Technica

This app had an Android Auto-like interface, but for people without compatible cars.

The Lighter Side

Boeing to ground Starliner indefinitely until valve issue solved

From Ars Technica

"I know this is very, very hard on our NASA and Bo...

Tools for Dev (SSMS, ADS, VS, etc.)

SSMS and SQLCMD: Prevent T-SQL Batch From Not Only Executing, but Also From Parsing (Cruel Joke #3)

From SQLServerCentral Blogs

(last updated: 2021-08-13 @ 19:50 ET / 2021-08-13 ...

Deploy SQL Server on Azure VM using Jupyter notebooks in Azure Data Studio

From SQLShack

This article will deploy SQL Server on Azure VM using a Jupyter notebook in Azure Data Studio. Introduction The SQL on Azure VM is an Infrastructure-as-a–Service(IaaS) for migrating or...

 
RSS FeedTwitter
This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com. Note: This is not the SQLServerCentral.com daily newsletter list, and unsubscribing to this newsletter will not stop you receiving the SQL Server Central daily newsletters. If you want to be removed from that list, you can follow the instructions on the daily newsletter.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -