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
 

Model Good Behavior

I'm answering a question in the forums and I spot something that crawls up my spine:

;WITH...

The person was using a Common Table Expression (CTE) which requires that the preceding statement in the batch have a statement terminator, the semi-colon. However, since the terminator isn't required everywhere, lots of people don't use it at all. And then, when it comes to writing a CTE, for convenience, they stick the terminator, you know, the thing that goes at the end of something, at the beginning of the CTE definition. Only, this time, they were trying to use two CTEs and had the terminator in there twice, obviously breaking the code.

Why would they think they're supposed to put that semi-colon at the front of the CTE? Because it's been modeled to them that way. For convenience, and repeatability, and just to reduce the number of complaints, a lot of people posting example code, put the terminator in front of their WITH clause. I get it. Those are reasons to model, what is actually a poor practice, as a way to make things easier. Same with using SELECT * in example code. You also see a lot of example code with all sorts of other bad behaviors because, hey, it's just an example. You also see it in other kinds of code, where the "Hello World" example, is poorly structured and badly written, but, hey, it's just an example.

And then we wonder why so many people are writing so much bad code. Well, we're teaching them to write bad code.

Look, if we want people to do things correctly, we need to model that good behavior. It's how you teach. Do the things you know to be right, all the time, in order to show others that's how they should be getting stuff done. Is it inconvenient to remove SELECT * from your example code? Good gosh yes. I'm actively rewriting one of my books and I'm throwing out almost every instance of SELECT * (except a couple where I use it on purpose to illustrate a point). It's work. However, it's necessary. If I'm going to teach people how to do things, I need to model good behavior, from the start, and all the way through. Even if it inconveniences me (and yeah, worth mentioning, I was dragged to this point of view in part by Hugo Kornellis, I'll let him tell the story).

OK. You can start flaming me now.

Grant Fritchey

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

Reporting on the Progress of a Flyway Database Development Project

This article demos a novel way to report on the progress of your Flyway development project. It provides both SQL and PowerShell versions of code that extracts information for each database version from the Flyway schema history table and then plots it in a Gantt chart.

AI/Machine Learning/Cognitive Services

Scheduling Azure ML Compute Instance Start-Up and Shut-Down

From Curated SQL

I have a post correcting a statement I made before...

Administration of SQL Server

Tested TDE with Instant File Initialization on SQL Server databases

From SQLServer-DBA.Com

Testing impact of Transparent Data Encryption on ...

Cause and Effect with Causality Tracking

From Callihan Data

For this month’s T-SQL Tuesday, I discussed my c...

T-SQL query to change the job owners for all jobs owned by a specific login

From SQLServerCentral Blogs

Many SQL Server DBAs manage jobs through the SSMS ...

Identify When your SQL Database Was Last Used

From SQLServerCentral Blogs

Database servers are used for storing vast amounts...

How SQL Server executes a Query

From SQLServerCentral Blogs

Beginning with today, I want to give you over the ...

Checking if a database has a master key–#SQLNewBlogger

From SQLServerCentral Blogs

Another post for me that is simple and hopefully s...

Display dates between two input dates using SQL DATEDIFF function in SQL Server

From SQLServerCentral Blogs

SQL Server has a very useful function called DATED...

Fixing a giant or running a SQL Server project deployment with Temporal tables

From SQLServerCentral Blogs

(2022-Jan-27) When Hogarth, a nine-year-old boy, ...

Lesson Learned #184: Row Level Security and Parallelism

From Azure Database Support Blog

Today, I worked on a service request that our customer reported that running a complex query this is executing in parallel but having more than 2 vCores in Azure...

An Overview of System Function LOGINPROPERTY for SQL Login Details

From MSSQL Tips

In this article we look at the SQL Server function LOGINPROPERTY to retrieve various settings for any SQL Server login.

SQL Server agent jobs without notification using T-SQL

From SQLServerCentral Blogs

This article will describe how to get a list of SQL Server agent jobs without notifications using T-SQL . Read more here The post SQL Server agent jobs without notification...

SQL 2019: Physical reads are counted two times for read-aheads in sys.dm_exec_query_stats

From SQL Seeker

Microsoft recently released Cumulative Update 15 for SQL Server 2019. It contains a bunch of fixes and some improvements, I get a bit geeky with updates like this and...

SQL Server – Retrieve Physical Cores, Physical and Virtual CPUs, and Processor type information

From SQLServerCentral Blogs

Today's post describes SQL queries to get the following information about the processors of a SQL Server instance: 1. The total number of ph The post SQL Server – Retrieve...

SQL Server - How to comma-separated values into different columns

From SQLServerCentral Blogs

This article will demonstrate the method to store comma-separated values into different columns using SQL Server(T-SQL) query. The post SQL Server - How to comma-separated values into different columns appeared...

Get SQL Server Configuration using T-SQL

From SQLServerCentral Blogs

As a SQL architect or database administrator, it is required to know how to get SQL Server configuration using T-SQL. This post will share The post Get SQL Server Configuration...

Analysis Services / BI on the MS Stack

Solve "A Puzzle for Pirates" with SAS

From AllAnalytics

This article introduces how to solve the pirate game with a recursive solving algorithm in SAS, and how to analyze and visualize the law behind the complex logic of...

Azure CosmosDB

Introduction to Azure Cosmos DB a NoSQL Database for Documents and JSON

From MSSQL Tips

In this article we look at how to implement Azure ...

Azure Cosmos DB introduction

From SQLServerCentral Blogs

Azure Cosmos DB is the next-generation database that offers the highest performance, availability, and scale, built for globally distributed The post Azure Cosmos DB introduction appeared first on SQLServerCentral.

Azure SQL

Generally available: Azure Database for MySQL – Flexible Server in two new regions

From Azure Updates

Provision your Azure Database for MySQL - Flexible...

Introduction to Azure SQL Bindings for Azure Functions | Data Exposed

From Azure SQL

Azure Functions are a serverless solution that allows you to write less code, maintain less infrastructure, and save on costs. Azure SQL bindings for Azure Functions make integrating your...

Azure Synapse (SQL Data Warehouse and Data Lake)

From Cosmos DB to the Synapse Dedicated SQL Pool

From 36 Chambers – The Legendary Journeys

With the announcement back at Ignite that SQL Serv...

Discovering diagram of dependencies in Synapse Analytics and ADF pipelines

From SQLServerCentral Blogs

Documenting objects dependencies of ETL processes ...

Azure AD for Azure Data Services: Synapse Edition | Data Exposed: MVP Edition

From Azure SQL

When working with Azure data services it is nearly...

Community Interests

How AI Can Transform Hybrid Events

From Dataversity

The initial phase of the global pandemic shocked nearly every industry, with in-person events effectively grinding to a halt. Industry conferences that millions of people had relied on for...

Computing in the Cloud (Azure, Google, AWS)

Five risks of moving your database to the cloud

From Technology Review Feed - Tech Review Top Stories

Moving to the cloud is all the rage. According to ...

Easily Deploy SQL Server Always On via AWS Launch Wizard

From MSSQL Tips

In this article we look at how to use the AWS Launch Wizard to quickly deploy SQL Server Always On environment to support Availability Groups.

General availability: Azure Key Vault increased service limits for all its customers

From Azure Updates

Azure Key Vault service throughput limits have bee...

Public preview: Azure Percept DK January (2201) software update is available

From Azure Updates

The Azure Percept January update includes fixes re...

Public preview: Multitasking in the cost analysis preview

From Azure Updates

Azure Cost Management has a new tabbed experience ...

Creating Data Lifecycle Management Rules for AWS S3, Part 1

From IT Pro - Microsoft Windows Information, Solutions, Tools

Data lifecycle management rules can help organizations drive down costs. Learn how to create lifecycle rules in part one of this two-part article.

DMO/SMO/Powershell

Only One Join-Path Is Needed

From No Column Name

Time to read: ~ 3 minutes Words: 571 Update: Learn...

Data Mining / Data Analysis

The product of doubly stochastic matrices is doubly stochastic

From Statistical Odds & Ends

A matrix with non-negative entries is said to be d...

Still Not Convinced About Data Storytelling? Read This

From Dataversity

Data on how organizations operate can inform how t...

4 ways to find the k smallest and largest data values in SAS

From AllAnalytics

Sometimes it is useful to know the extreme values ...

How to use the SAS Auto Call facility

From AllAnalytics

Many SAS programmers use macros. I have seen students in my SAS classes use several methods to activate their macros. One way is to load the macro in the...

Data Privacy, Compliance, and Governance

Five Data Governance Trends for Organizational Transformation in 2022

From Dataversity

The importance of data has increased multifold as ...

Database Design, Theory and Development

A new era for data: What’s possible with as-a-service

From Technology Review Feed - Tech Review Top Stories

For organizations in today’s complex business en...

Is it ok to use proprietary database features

From Lee Markum

  I was recently thinking of SQL Server temporal ...

What Is File Storage and Block Storage?

From IT Pro - Microsoft Windows Information, Solutions, Tools

File and block are the predominant storage access protocols. Their characteristics make them suitable for different applications and workloads.

What Is Data Modeling? Types, Techniques & Examples

From Past News - RSS Feeds

Data modeling comprises the methodologies of creat...

DevOps and Continuous Delivery (CI/CD)

Why DevOps needs a change from a ‘me’ to a ‘we’ mindset

From Blog – Redgate Software

What is DevOps and how should organizations introd...

DBAs and DevOps

From Simple Talk

Lately, you’ve heard about DevOps. Is it just another buzzword, or is it something you should investigate? DevOps emerged over ten years ago to solve the problems of the...

Configure Transfer Database Task in SSDT 2017

From SQLShack

This article explains the transfer database task in SSDT 2017. After reading this article, you will be able to transfer the databases between the same server or different servers....

DocumentDB/Key-Value/Graph/other NoSQL Databases

How to insert into a Hive table when the table has columns with complex types like Arrays?

From Hadoop in the Real World

Let’s consider the below table employee_depts  ...

ETL/SSIS/Azure Data Factory/Biml

ADF and MySql.Data.MySqlClient.MySqlException,Message=Got a packet bigger than 'max_allowed_packet'

From World of Whatever

Azure Data Factory, ADF, and exception MySql.Data.MySqlClient.MySqlException,Message=Got a packet bigger than 'max_allowed_packet' My StackOverflow developer profile specifies "I'd prefer to not work with" and honestly, the only...

T-SQL Query to change Integration Services Catalog (SSISDB) database Master Key encryption password

From SQLServerCentral Blogs

Learn how to change the Master Key encryption password for an SQL Server Integration Services Catalog (SSISDB) database in SQL Server. The post T-SQL Query to change Integration Services Catalog...

MDX/DAX

[DAX] Anti-Patterns Episode Two SELECTEDVALUE() (with Daniil Maslyuk)

From Havens Consulting

A lot of videos and articles teach you how to writ...

Oracle

Oracle to Azure Refactoring Go or No-Go Indicators

From DBAKevlar

When migrating an Oracle database to another platf...

Transformations by the Oracle Optimizer

To troubleshoot poorly performing SQL in Oracle, you must understand which transformations the optimizer has made. Jonathan Lewis demonstrates several possible optimizations for one query.

Performance Tuning SQL Server

Which Columns Are Looked Up?

From Scary DBA (Grant Fritchey)

A common issue in performance is the lookup, key o...

Fixing Performance Regressions Before they Happen

From Netflix TechBlog - Medium

Angus Croll Netflix is used by 222 million members...

Minimizing SQL Server PAGELATCH_EX Waits on Index Pages for UPDATE Statements

From MSSQL Tips

In this tip we will look at some different options...

Query Simplification: Join Removal with Foreign Keys

From SQL Seeker

Foreign keys are used in database design to enforc...

PostgreSQL

Configure ODBC drivers for Azure Database for PostgreSQL

From SQLShack

This article helps you learn how to configure an O...

PowerPivot/PowerQuery/PowerBI

How to use the Power BI Embedded Playground

From FourMoo

One of the great things about Power BI is how they...

How Parameters work with the Power BI Paginated Visual

From Guy in a Cube

Parameters for the Power BI Paginated visual can g...

Power BI Sandbox: An Environment to Learn Power BI Service for Free

From RADACAD

A question I often get from many students is: “H...

Create a date range parameter with Power BI Paginated Reports

From Guy in a Cube

How do you do a date range with the Paginated visu...

Vertipaq optimization and its impact on columnstore compression

Vertipaq optimization is a critical component of the columnstore compression process. Edward Pollack explains how it works and what you need to know to manage it.

Professional Development

The Great Resignation: Does Switching Companies Hurt IT Careers?

From IT Pro - Microsoft Windows Information, Solutions, Tools

For those considering an IT career switch, 2022 ma...

2022: The Year Automation Comes to the Forefront of Reliability and Experience

From Dataversity

It’s no shock to anyone that 2021 was a year of big change, much of it due to the continued effects the global pandemic has on how we do...

SQL Server News

SQL Server 2019 Cumulative Update 15

From Glenn Berry

On January 27, 2022, Microsoft released SQL Server 2019 Cumulative Update 15. This is Build 15.0.4198.2. By my count, there are 35 public fixes and improvements in this CU,...

SQL Server Security and Auditing

Database security testing using SQL Server Vulnerability Assessments

From SQLShack

I will explain how to use and perform security testing using SQL Server vulnerability assessment in this article. I have explained basic understanding about multiple layers of security that...

Security News and Issues

The Case for Backing Up Source Code

From Dark Reading: Dark Reading News Analysis

As enterprise data security concerns grow, securit...

Log4j Proved Public Disclosure Still Helps Attackers

From Dark Reading: Dark Reading News Analysis

Disclosure also puts organizations in the awkward position of trying to mitigate a vulnerability without something like a vendor patch to do the job.

With Cloud the Norm, Insiders Are Everywhere — and Pose Greater Risk

From Dark Reading: Dark Reading News Analysis

After companies accelerated their adoption of cloud infrastructure, remote workers are now insiders and pose significant risks, and costs, to companies.

Data Privacy Day 2022: How Can AI Help in the Fight Against Ransomware?

From Dark Reading: Dark Reading News Analysis

Fewer than one-quarter of organizations believe they are fully prepared for a ransomware attack, threatening data privacy

Tracking Secret German Organizations with Apple AirTags

From Schneier on Security

A German activist is trying to track down a secret government intelligence agency. One of her research techniques is to mail Apple AirTags to see where they actually end...

Software Development

Defining Technical Debt

From Paul Andrew

Is it OK to have technical debt? A few times now I’ve been asked to define technical debt. It can be an ugly term if your role is a...

Detect Accidental Blocking Calls when Using R2DBC

From Java, SQL and jOOQ.

A while ago, jOOQ has added the org.jetbrains:annotations dependency to the jOOQ API, in order to annotate return types with nullability information. For example, the entire DSL is non-nullable:...

T-SQL

Writing Testable Code: the Functional Approach

From 36 Chambers – The Legendary Journeys

In yesterday’s post, I covered the resources I u...

Using T-SQL to Answer Date-Related Calculations

From SQLServerCentral Blogs

There are many interesting questions related to date calculations. For example, I have seen the following questions Give a date, find the first Tuesday day of the previous week/month/quarter,... The...

Parsing scripts with ScriptDOM

From Curious..about data

In the last post I wrote about what ScriptDOM is and why it is useful. From this post, I will explain how it can be put to use. What...

 
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

 

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