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

The Art of Commenting

This week I noticed an article on comments in PoSh over at Simple Talk. It's a nice look at the topic from Greg Moore and discusses the various ways that you can comment in the language. Since these scripts are often shared in a corporate environment and because they may outlast your tenure, it's a good idea to include comments in your scripts and functions.

The idea with PowerShell is similar to what you get from docstrings in Python. Since many people can script and build modules, being able to get some help and understanding of the code is important. Even for the modules I write, I may use them for some time and then put them down. When I go to use the same cmdlet or function again, I might not remember all the parameters or what I was thinking. If you've ever had to dig into code to understand what is happening, you quickly learn to appreciate those well documenting help strings.

You may quickly learn to despise those that don't write them well or even forget to include them at all.

Writing a useful comment is a bit of an art. The author often needs to put themselves in the shoes of a less skilled individual, or maybe one that is context switching and needs to quickly understand what the code is doing. Not necessarily exactly how it works, but what it is supposed to do. This helps us decide if we can use the code quickly, or if we might need to dig in further.

In the article, Greg points out some nice additional comment items, such as requirements for the module to run. These are the types of quick enhancements to code that greatly improve its useability for others. I'd highly recommend everyone learn about comment based help in PoSh, docstrings in Python, and other valuable commenting techniques in your language of choice.

Learning to write good comments is a valuable skill, one that your team will appreciate. Since most of us work on teams these days, those skills just might make you more desirable for that next promotion or even a new position when word gets out. Practice becoming a good comment writer.

Steve Jones - SSC Editor

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

 
Redgate Data Masker
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.
AI/Machine Learning/Cognitive Services

Evaluating Models in Azure Machine Learning

A common task in data science and analytics involves using data to make predictions. Predictions can add a tremendous amount of value to businesses, allowing them to plan ahead, focus resources and increase efficiency.

Administration

Creative Database Naming

Every now and again, we as DBAs need to get away from the daily grind of the hum drum tasks. We need to find a way to have a... The...

Fixing A previous restore operation was interrupted and did not complete processing

I recently was working on a customer system where a myriad of bad things had occurred simultaneously that left them in a scenario where their primary database server had...

Creative Extended Event Sessions

A picture is worth a thousand words, right? Sometimes, a picture for an event session just may be able to say it better than 50-60 letters used to try... The...

Negative Port Numbers

Validating your server setup is an integral component of your duties as a SQL Server DBA. When performing those validations, it is possible to run into an intriguing difference... The...

Cannot Open Backup Device

When running into error 1326, it makes plenty of sense to try to create a backup dump device (only as a testing exercise) as well as test the connectivity... The...

Analysis Services / BI on the MS Stack

BI: Wondering where you Integration Services Connector for Power Query has gone in Visual Studio 2019?

I wrote recently about menu items being missing from SSIS and other BI projects in VS2019, but another thing that's gone MIA is the Integration Services Connector for Power...

Azure Databricks, Spark and Snowflake

Snowflake for SQL Server Users – SQL Language Differences

I posted last time that I'd completed my Part 1 eBook on Core Concepts. The Part 2 eBook is on the differences in the SQL language between Snowflake and...

Snowflake for SQL Server Users – A Christmas Present

I've had a lot of great feedback on my series of blog posts about Snowflake, and explaining the concepts for an existing SQL Server audience. Just out for Christmas...

Azure SQL Managed Instance

SQL SERVER – SQL Azure Managed Instance Restore Error – The Database Was Backed Up on a Server Running Version 15.00.2000

One of my clients migrated to SQL Azure Managed Instance and contacted me for an interesting situation. Let us resolve Restore Error. First appeared on SQL SERVER – SQL Azure...

Redgate University
Career Growth and Certifications

What should be your Salary in 2020 if you work with Power BI?

The Power BI 2020 Salary survey was popular enough...

Learning Goals for 2020

Unlike the last couple of years (e.g., 2019), I’...

Passing MS Exam 70 – 768: Developing SQL Data Models

Introduction The purpose of this blog is to provide brief overview of the MS Exam 70-768 with focus on the preparation from the perspective of a junior MSBI developer....

What is the Merit of the Job?

One tries to climb the ladder of success but at th...

20 Things You Need to Stop Doing in 2020

For years I have written a year end post about things that didn’t happen to me for the previous twelve months. This year I’ve decided to pivot that theme....

Happy new year 2020 and goals not resolutions

Wow, it's been a really big year in many ways. I had a list of goals for the year, and overall I'm pretty happy with where it's ended up....

2019 in Review

What an incredible year it’s been.  I kept thinking that I was busy, but I had no idea until I looked at the final numbers (I have a Power... The...

Community Interests and PASS

Ending My Time as PASS President

With the end of the year, other things are coming ...

Computing in the Cloud (Azure, Google, AWS)

Predictions 2020: What's Going to Happen in Cloud Computing

eWEEK PREDICTIONS 2020: The continued development ...

IT Managers Looking for Consistent Cloud Services Controls

eWEEK TREND ANALYSIS: Cloud services are now the n...

Conferences, Classes, Events, and Webinars

Honored to Present Azure DevOps and the SSIS Development Lifecycle at Hampton Roads SQL Server User Group 15 Jan 2020!

I am honored to present Azure DevOps and the SSIS ...

SQLSaturday Tampa 2020 (On Leap Day!)

Feb 29, 2020 is the date for SQLSaturday Tampa, nu...

DMO/SMO/Powershell

Powershell : Desire State Configuration -DSC

Powershell in 2012, Powershell 4.x onwards introdu...

Comments and More in PowerShell

Comments are helpful when programming in any langu...

Get a List of Files with Data

The trick here is to find a way to search thousand...

Data Mining / Data Analysis

Dell’s Jeff Clarke Looks to 2020 and the 'Next Data Decade'

eWEEK TREND ANALYSIS: Dell Technologies' COO and v...

ETL/SSIS/Azure Data Factory/Biml

Batch Goes Out the Window: The Dawn of Data Orchestration

eWEEK TREND NEWS: A whole new class of technologie...

Hardware

CES 2020: Dell’s 360-Degree Latitude 9510 to Offer 30 Hrs Battery and 5G Modem

Building a workstation-class mobile PC that would ...

Dell updates popular XPS 13 laptop with 16:10 screen, IR camera

And new Latitude laptops may entice business users...

Lenovo’s 2020 ThinkPad X1 Carbon & Yoga: Wi-Fi 6, New Keyboard, & Security Features

Lenovo’s ThinkPad X1 Carbon and ThinkPad X1 Yoga...

Lenovo Unveils ThinkVision Creator Extreme P27: A Professional Monitor with Mini LED FALD

Continuing our run of CES 2020 announcements, Leno...

AnandTech Year In Review 2019: Lots of CPUs

Throughout 2019, we’ve had quite the reverse of performance when it comes to the competitiveness of the modern performance-oriented desktop processor. This year we’ve seen AMD introduce its Zen...

MDX/DAX

What has happened in the DAX world in 2019

Another year has gone by and it has now been 10 years since DAX was first introduced in late 2009. As usual, it is time to review the past year and to take a look at the year ahead.

What has happened in the DAX world in 2019

Another year has gone by and it has now been 10 years since DAX was first introduced in late 2009. As usual, it is time to review the past...

Performance Tuning SQL Server

Did My UDF Inlined?

With the release of SQL Server 2019, CTP 2.1 new features were added to Intelligent Query Processing (QP) feature family. One of those features was Scalar UDF Inlining.

Eager Index Spools From Nonclustered Indexes

Dangarang

SQL SERVER – DATABASE SCOPED CONFIGURATION – PARAMETER SNIFFING

My client had hired me after reading my recent series on Parameter Sniffing. Today, we will discuss Database Scoped Configuration - Parameter Sniffing. First appeared on SQL SERVER – DATABASE...

SQL SERVER – Parameter Sniffing and OPTION (RECOMPILE)

I strongly recommend that you read my earlier blog posts on this topic before you consider the option of recompile suggested in this blog post. First appeared on SQL SERVER...

SQL SERVER – Performance and Recompiling Query – Summary

I have been having with many of the readers after reading the latest blog post series on Performance and Recompiling Query. First appeared on SQL SERVER – Performance and Recompiling...

PowerPivot/PowerQuery/PowerBI

A Primer for the Microsoft Power BI Color Picker

With the December Power BI Desktop update, users are introduced to a new color picker when customizing theme colors. The new color picker is much more versatile than the original when selecting colors.

Drillthrough in Power BI

The drillthrough feature in Power BI will let you let you go into more detail about a specific column in a visualization.

Aggregations and Time Series calculations in Power BI

Let’s take a quick look at one such calcualtion and how it can be covered with an aggration. I am going to use the same version of AdventureWorks sample database and Power BI model that I used in my previous blog post on aggregations, with a few changes.

Power BI and Excel

Power BI and Excel are tools so close to each othe...

Change Excel Source in Power BI to OneDrive for Business – No Gateway Needed

If you used an excel file in a local source (or even OneDrive for Business, but sourced locally), you need to do one extra step to make your query...

Using Calendars and Dates in Power BI

You can use a host of time-intelligence functions ...

Product Reviews and Articles

Monitoring SQL Server with Splunk and SQL Monitor

Splunk is a search engine for collecting and analyzing all sorts of "machine data", including log data and metrics for SQL Server. SQL Monitor gives you the detailed diagnostic...

Removing the Square Bracket Decorations with SQL Prompt

If you avoid illegal characters and reserved words in your identifiers, you'll rarely need delimiters. Sadly, SSMS applies square bracket delimiters indiscriminately, as a precaution, when generating build scripts....

Resolving Merge Conflicts in SQL Source Control – the Basics (video)

In this 35 minute livestream recording, I commit conflicting code to a Git repo in Azure DevOps Services using Redgate’s SQL Source Control, then step through options to fix...

Product Upgrades and Releases

Announcing GA of the Integration Services Projects Extension for Visual Studio 2019

The Microsoft SSIS Team announces the general availability (GA) of the SSIS Projects for VS2019 version 3.3! In this version, the biggest change is that we removed Power Query...

Python

Understanding Customer Attrition Using Categorical Features in Python

Are you interested in guest posting? Publish at DataScience+ via your RStudio editor. Category Programming Tags Data Visualisation Machine Learning Python Sentiment Analysis Customer attrition is a metrics used by many businesses to monitor and quantify...

SQL Server Security and Auditing

SQL 2019: Always Encrypted with Secure Enclaves, Part 2

For this post, we’ll be using Powershell to install and configure the HGS server (required for “attestation”) as well as executing the steps required to configure the SQL 2019 server to work with HGS.

Software Development

Why You Need to Consider Microservices Architecture Now

Click to learn more about author Ariff Kassam. Many companies are considering migrating their legacy applications to cloud-computing models and implementing microservices as part of that migration. These organizations...

T-SQL

Introduction to Gaps and Islands Analysis

T-SQL window functions simplify solving many complex queries. In this article, Edward Pollack demonstrates how the functions can be used to find gaps and islands in a dataset.

SQL: Find nearest enabled parent in a hierarchy using T-SQL

I was recently answering a forum question about wo...

SQL SERVER – ISNUMERIC Function and Interesting Result

Let us learn, ISNUMERIC Function and Interesting R...

T-SQL Basics: using OUTPUT

You are working on a database development project, and you need to obtain the records before/after an INSERT, DELETE, UPGRADE or MERGE Statement to present it to the user... The...

T-SQL 101: #50 Using CHARINDEX and PATINDEX to find one string in another in SQL Server

It's useful to be able to find one string within another string. T-SQL has two basic functions for that: CHARINDEX and PATINDEX. CHARINDEX is used to see if one...

Computed Column Follies

Darnit While helping a client out with a performance problem recently, I ran into something kind of funny when creating…

Dates Aren’t Strings

Seriously.

SDU Tools: Script User Defined Database Role Permissions in SQL Server

As part of our free SDU Tools for developers and DBAs, we have many scripting functions. SQL Server allows you to create your own database roles, and generally, you...

Tech News

Five Technology Trends in 2020 that Will Affect Your Business

eWEEK NEWS / TREND ANALYSIS: Technologists are predicting vast changes that they say will show up in 2020, but it’s important to remember that just because something might be...

Organizations Need to be Prepared for Quantum Computing Threats

eWEEK TREND ANALYSIS: Amazon joined the quantum co...

No foolin‘—the 2010s were a crazy decade for tech

Spaceflight lived, software ownership died, and net neutrality lived and died.

The Lighter Side

This may be a transcendent year for SpaceX

Company may attempt 50% more launches than any pre...

Lidar sensors are about to become a mainstream car feature

Bosch, a "tier 1" auto supplier, is entering the crowded lidar market.

To replace gas taxes, Oregon and Utah ask EVs to pay for road use

Gas taxes pay for the upkeep of our roads, but electric cars don't use gasoline.

You’re In No Shape To Be Reading

Vitamin Advil

Virtualization and Containers/Kubernetes

Securing Kubernetes: Best Practices

Click here to learn more about Gilad David Maayan. Kubernetes (k8s) is a popular container orchestration platform. However, the rush to adopt k8s technologies can lead to errors. In...

 
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

 

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