Press "Enter" to skip to content

Curated SQL Posts

Finding Cmdlets in Powershell

Jack Vamvas helps us with cmdlet lookup:

Question: I need to interrogate the module for a Powershell cmdlet but I can’t find the actual physical location of the file on the host server.  I can execute the cmd through the Powershell command line OK , but can’t find the powershell cmd file. Is there a Powershell method of locating the Powershell module files?

Click through to see the answer.

Comments closed

Restoring Databases from Blob Storage Files

Stuart Moore talks us through a (rare) gap in dbatools:

In the comments here I was asked about using Restore-DbaDatabase when all you have is blobs in an Azure Storage account. This can be done, involves a couple of non dbatools steps.

Restore-DbaDatabase doesn’t natively ‘talk’ Azure, nor do any of the other dbatools commands. The reason for this is that we didn’t want to force dbatools users to have to install the AzureRM/Az powershell modules just to use our module. We’ve gone to a lot of effort to make sure that dbatools is acceptable to Security Admins and that it has a small(ish) footprint, and adding those large modules as prerequisites would have broken that.

Read on for how you can get around that.

Comments closed

Securing Databricks on AWS

Andrew Weaver, et al, take us through security practices for running Databricks on AWS:

In this article, we will share a list of cloud security features and capabilities that an enterprise data team can use to harden their Databricks environment on AWS as per their risk profile and governance policy. For more information about how Databricks runs on Amazon Web Services (AWS), view the AWS web page and Databricks security on AWS page for more specific details on security and compliance.

Click through for that list.

Comments closed

Error Handling Patterns in Kafka

Gerardo Villeda gives a few options for handling errors in an Apache Kafka topic:

Apache Kafka® applications run in a distributed manner across multiple containers or machines. And in the world of distributed systems, what can go wrong often goes wrong. This blog post covers different ways to handle errors and retries in your event streaming applications. The nature of your process determines the patterns, and more importantly, your business requirements.

This blog provides a quick guide on some of those patterns and expands on a common and specific use case where events need to be retried following their original order. This blog post illustrates a scenario of an application that consumes events from one topic, transforms those events, and produces an output to a target topic, covering different approaches as they gradually increase in complexity.

Click through for the list. Each explanation is pretty short, but opens the door for further analysis.

Comments closed

Comparing Datasets in R

The folks at finnstats take us through a package to compare datasets in R:

How to find dataset differences in R, when the pieces of information are changing between datasets it’s a difficult task to identify the same.

Here we are going to discuss the daff package in R, daff package helps us to identify the differences and visualize them in a beautiful way.

Click through for the demonstration, including a video. H/T R-Bloggers

Comments closed

Handling Disaster Recovery

Randolph West has a disaster recovery plan:

I’ve had several occasions where hard drives have failed and attempts to recover data from these wonders of mechanical engineering have been mostly fruitless. I’ve experienced profound examples of data loss, in both cases losing years of email and contact details for people I met online.

This is all to say that I care deeply about data loss, and I take it personally when I’m asked to engage with potential customers to recover data in SQL Server.

This post is a high-level overview of how I tackle data recovery, whether personally or for professional consulting reasons.

Click through for the steps.

Comments closed

Visualizing with Text

Alex Velez shows how you can use simple text to share information:

If you’re unsure about what I mean when I say simple text, I’m referring to the idea that just because you have numbers doesn’t mean you need to build a graph—as in this simple text example. Sometimes words with big numbers written in bold fonts (aka BANs) are more effective, especially when communicating one or two data points.

Some people’s hesitancy with simple text is that they think it’s unrealistic: the notion that you might only share one or two numbers with an audience. It’s is a fair point; it does seem a bit silly to think that you’d only talk through a couple of specific values when presenting data—even though I’m sure there are such occasions. Rather than thinking of the ideal use-case for simple text as when you only have one or two numbers in totality, consider when it may make sense to draw attention to one or two numbers in your larger story.

This is a good reminder that you don’t need everything to be fancy, shiny, and visual-laden. A little bit of text can go a long way in laying out a visual. That said, the warning is that text seems to be a little easier for people to miss, especially if there’s a lot of it. That’s where Alex’s explanation really pays off.

Comments closed

Creating an Azure SQL Database from Powershell

Gijs Reijn shows how to automate the process of creating an Azure SQL Database using Powershell:

Before you can create an Azure SQL database, you must create an Azure SQL server to host it on. Assuming you’re already authenticated to Azure:

Open PowerShell on your local computer and create the Azure SQL server that will host the Azure SQL database.

The command below is creating an Azure SQL server called sqlestate in the prerequisite resource group with a SQL admin username of SqlAdministrator and a password of AVeryStrongP@ssword0. The command is saving the output of the New-AzSqlServer cmdlet to use attributes from the server created later.

Read on for the step-by-step breakdown and full script.

Comments closed

Searching through Stored Procedures using dbatools

Jess Pomfret has another way to search through stored procedure text:

When we’re looking for the command we need within dbatools to fulfil our needs I cannot recommend Find-DbaCommand highly enough.  This command will search all other commands for the pattern you pass in.  Today we know we want to find references in stored procedures so let’s see if there is a command that will help.

Seems like querying sys.sql_modules is a little easier, though if this is a step in a pipeline (such as finding old procedures based on some no-longer-appropriate code snippet and deploying new versions), this can be a good first step.

Comments closed