Categories
SQL Server

The Cost of Convenience with the Import Data Wizard

If you need to create a copy of a table in another database, the ‘Import Data’ option may seem convenient. If you’ve used this method to copy to your dev environment and found things break, this post is for you. By letting the wizard create the destination table automatically, you might find your schema is […]

Categories
SQL Server

Understanding SQL Server’s Dedicated Admin Connection (DAC)

Slow queries are one thing, but under heavy pressure, your SQL Servers might see failed connections or slow responses. When the server isn’t responding we want a back-door we can crack open. In SQL Server, this comes in the form of a Dedicated Administrator Connection (DAC). In this post I want to look at what […]

Categories
SQL Server

Discovering More About Join Operator Internals

In the previous post I explained Join Operators in SQL Server. Whilst compiling that I dug a little deeper and came across a few interesting points I thought were worth sharing. Let’s look at behaviour of the operators which may occur under specific conditions. Hopefully you find them as interesting as I did: Optimised nested loop […]

Categories
SQL Server

SQL Server Join Operators Explained

When reviewing our execution plans we’ll see joins executed using different operators. The type of operator is chosen based on the data that’s available to join and how the optimiser wants to execute it. In this post we’ll take a look at what the operators are, when they are used, and how they work. These […]

Categories
SQL Server

Fixing Orphaned Database Users

When restoring a database in different environments we may stumble across orphan users. This typically manifests through failed connections to the database. Here we’ll have a quick look at what the issue is and 3 ways to fix it. What are orphaned users When users are created in a database they’re mapped to the login […]

Categories
SQL Server

Simple Point in Time Database Restores

A few weeks ago I demonstrated the simplicity of performing point-in-time database restored in Azure Managed Instance. Whilst that has a lovely front-end, it can be just as easy with a proc call on your traditional SQL instance. Let’s see how to use two open source tools to achieve this simplicity. Back it up Before we […]

Categories
Azure SQL Server

Configuring Database Mail for SQL Agent Notifications in Managed Instance

SQL Agent jobs allow us to schedule and automate tasks on a SQL Server instance. Crucially, when things go wrong we need to know about them. That’s why we use notifications. Setting up Operators and job Notifications is as expected on a Managed Instance. However, when it comes to sending the notifications we may have […]

Categories
SQL Server

Ingesting Azure Blob Data Directly to SQL Server

We may associate consuming data from Azure Storage with tools like Data Factory or even SSIS as we saw recently. We don’t always need the middle man though. Here we’ll demonstrate how to use an External Data Source to perform the ingestion directly into SQL Server. Firstly we need the credential to authenticate against the storage. […]

Categories
SQL Server

Using External References with Data-Tier Applications

One method for transferring a database to a different environment is using a Data-Tier Application – in the form of a DACPAC (for schema) or BACPAC (for schema and data). Trying to use this approach with multi-database solutions is a challenge though as Data-Tier Applications don’t play nicely with cross-database objects. Let’s look at how we can […]

Categories
SQL Server

Creating a Role for Proc Execution

We have database roles for reading and writing data but interestingly there’s no role which provides permission to execute procedures. Most DBAs I’ve worked with – production or development – prefer to use stored procedures for data access rather than an ORM. A role to allow procedure execution would be very handy. So let’s fix […]