SQLServerCentral - www.sqlservercentral.com

A community of more than 1,600,000 database professionals and growing

Featured Contents

The Voice of the DBA

DR Prep Can Miss the Little Things

The other day we had a blizzard in Colorado and we weren't quite prepared. My wife and I were away on a trip and watching the weather. We were concerned about flights and about the conditions at the ranch with someone else in charge of horses. We were lucky in that the weather didn't come as quickly as predicted and we made it home before the snow started.

Depending on moisture and temperature, we sometimes put blankets on horses, which is a chore that I'm not very good at completing. Fortunately the kids were around and at 8pm, we all dressed in warm clothes and headed out to the barn. The horses depend on us to provide for some of their needs, so we each had jobs to do. One kid secured a temporary holding area to keep horses nearby. One gathered 14 or 15 blankets from storage and laid them out. My wife made grain to facilitate attracting the horses and giving us a way to hold them while blankets went on.

Me? I had the envious task of double checking electricity and tank water headers. Our employee had thought that one was shorting out and at night, with a flashlight and plug tester, i got to debug 4 water heaters, including one that's semi-remote from the barn. Testing for shorts involves touching water to see if there is any flowing power (this is very low amperage), which isn't terribly dangerous, but is a little daunting. We managed to get everything done, and felt like we were prepped for a 4-10" snowfall, 50mph winds, and a 0-5F temperatures.

Later I lay in bed, trying to relax with a little TV before calling it a night. While the wind was howling, I heard a pop and the power went out. We have a generator, and I wasn't too worried, but I did want to ensure it came on. I walked downstairs and across the house to listen for the engine noise. I heard cranking, but the engine didn't catch. It was then I remembered the tank was low the last time I checked, and with a weekly diagnostic auto run for 5 minutes, I was likely out of propane. Since we needed power to heat water for horses, I had to get up around 11pm and take care of things.

Fortunately I keep a spare bottle of propane and I went outside in the blowing snow to change it. A true work-at-home-techie, I did this without pants and got things running. Back to bed, though worried a bit about how to get more propane in the morning, just in case of an extended outage. The power came back on in the morning, but I still needed to get more propane just in case.

Extended disasters sometimes cause problems with our plans because many of us focus on the immediate reactions. Longer term, things like additional fuel, food for humans, even shelter and child care are issues that I've had to deal with in teams that no one had planned for. We've seen this over and over again in the world, especially when supply chains break down quickly in disaster situations.

I could have prevented some of the issues and stress if I'd prepped things better. I should have filled propane tanks earlier, knowing that bad weather can come at any time, and likely will at some time. Double checking heaters and power earlier might have made the blanketing process go quicker. There are always things we miss in prep, often ones we don't consider to be important, but may be difficult to deal with in the moment. Take a few minutes and think about the little things you might dismiss as not important. Imagine how hard some of them might be to deal with under the pressure and stress of a DR event. If you can do a little more prep, some maintenance, or get some work done early, now might be the time to do it.

Steve Jones from SQLServerCentral.com

Join the debate, and respond to today's editorial on the forums

The Voice of the DBA Podcast

Listen to the MP3 Audio ( 5.8MB) podcast or subscribe to the feed at iTunes and Libsyn. feed

The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music.


The 2019 State of Database DevOps results, live with Donovan Brown!

Thursday February 21, 16.00-17.00 GMT / 10.00-11.00 CST - Donovan Brown, Principal DevOps Manager at Microsoft, joins Steve Jones, Microsoft Data Platform MVP to discuss the latest in all things Database DevOps.
Register now

SQL Change Automation

CI/CD  for your SQL Server database

Feeling the pain of managing and deploying database changes manually? Redgate SQL Change Automation completes your database delivery process by building, testing, and deploying the database changes you and your team check into version control.  
Try it free

Featured Contents


Getting Started with Database containers

Steve Jones from SQLServerCentral.com

A beginning look at containers in Windows. More »


Empty Thoughts: Working with NULL

Additional Articles from SimpleTalk

Whether or not to have NULLable columns in a table can be a religious debate, and how missing data is represented should be carefully considered during database design. In this article, Joe Celko considers the ways that SQL Server handles NULLs in several situations. More »


Create, Protect and manage non-production databases with SQL Provision

SQL Provision allows teams to create a secure, scalable and repeatable process for managing data as it moves through your SQL Server estate, without causing administrative burdens. Tony Davis explains how SQL Provision can work alongside your existing database DevOps practices. More »


From the SQLServerCentral Blogs - Memory Grants part 5: Query hints

Arthur Daniels from SQLServerCentral Blogs

Proceed with caution, if you’re thinking of using query hints. This post will specifically cover min_grant_percent and max_grant_percent. My opinion on... More »


From the SQLServerCentral Blogs - Why You Shouldn't Use SELECT * In Production Systems (EVER!)

Gavin Draper from SQLServerCentral Blogs

OK so the title is a bit of a bold statement but bear with me, I’ve been burned by this... More »

Question of the Day

Today's Question (by Thomas Franz):

What will the last select return in the column [i] for txt in ('e', 'f')?

CREATE TABLE dbo.ident (i int IDENTITY, txt VARCHAR(100));
INSERT INTO dbo.ident (txt) VALUES ('a'), ('b')
SELECT * FROM dbo.ident AS i -- returns 1 a / 2 b
INSERT INTO dbo.ident (i, txt) VALUES (103, 'c'), (104, 'd')
SELECT * FROM dbo.ident AS i -- returns 1 a / 2 b / 103 c / 104 d
DELETE dbo.ident WHERE i = 104
INSERT INTO dbo.ident (txt) VALUES ('e'), ('f')
SELECT * FROM dbo.ident AS i

Think you know the answer? Click here, and find out if you are right.

We keep track of your score to give you bragging rights against your peers.
This question is worth 1 point in this category: IDENTITY.

We'd love to give you credit for your own question and answer.
To submit a QOTD, simply log in to the Contribution Center.


Design and configure SQL Server instances and databases in support of high-throughput applications that are mission-critical and provide consistent response times in the face of variations in user numbers and query volumes. Learn to configure SQL Server and design your databases to support a given instance and workload.

Pick up your copy of this great book today at Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

On SQL Server 2017, I have a brand new database with no objects. I run this code:


I now decide to query sys.objects with this code. How many rows are returned?

 FROM sys.objects AS o
 WHERE o.type = 'P'

Answer: 1, and no errors from procedure creation


There is an older feature of CREATE PROCEDURE that allows you to create versions of stored procedures. You do this with a semicolon and a number after the name.

This only creates one object in sys.objects.

Note this feature is in maintenance mode (deprecated), and should not be used.

Ref: CREATE PROCEDURE - click here

» Discuss this question and answer on the forums

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.

SQL Server 2017 : SQL Server 2017 - Development

Normalizing redundant data (is this 1NF, 2NF or 3NF) - In the example below, columns 2 - 4 are dependent on the EmpId column.  Columns 6 and 7 are dependent on the...

SQL Server 2016 : SQL Server 2016 - Development and T-SQL

Getting the right qualifications and selecting courses - Hi all, I'm based in the UK and have been put on notice of redundancy (along with 58 colleagues) as the...

Sort already comma separated list - Hi I have values like this in a column which basically is the exact same thing if sorted . ORM;

SQL Server 2014 : Development - SQL Server 2014

control order of execution within a stored procedure? - I have problem where a stored procedure is daily executed as part of an SSRS subscription, but the last of...

Reporting Services : Reporting Services

In SSRS, a Date Time parameter on Preview is not matching the deployed report - In SSRS, a Date Time parameter on Preview is not matching the deployed report. Is this something someone else has...

SSRS String values not passed as parameters to other reports - I have a situation where I need to have string values passed to sub-reports in SSRS (coded with Visual Studio...

Reporting Services : SSRS 2012

Query regarding how to use ISNULL in ssrs - I want to display results based on case statement or ISNULL or coalesce my query looks something like this CASE WHEN MiddleName...

Reporting Services : SSRS 2016

Page setup for reporting - setting header and footer page margins - Hi, Not sure if this is the correct place to post so apologies if not (please let me know which sub...

Data Warehousing : Integration Services

Coding for Failure? Or Just Planning for Issues? - A lot of times, when developing SSIS packages, I find myself adding tasks and components to help handle the situation...

This email has been sent to {user_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.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.
This transmission is ©2018 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com