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.
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
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
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 »
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 »
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
SET IDENTITY_INSERT dbo.ident ON
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
SET IDENTITY_INSERT dbo.ident OFF
INSERT INTO dbo.ident (txt) VALUES ('e'), ('f')
SELECT * FROM dbo.ident AS i
DROP TABLE IF EXISTS dbo.ident
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
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
(by Steve Jones):
On SQL Server 2017, I have a brand new database with no objects. I run this code:
CREATE PROCEDURE GetOne
CREATE PROCEDURE GetOne;2
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.
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.