SQL Homework – September 2022 – Query window challenge

Leave a comment

September 1, 2022 by Kenneth Fisher

I had every intention of doing Replication Part 2 this month but had a thought I liked better. I will get back to replication but let’s do something else this month.

I’m a firm believer that the GUI’s Microsoft has made for us are amazing. Azure Data Tools and SQL Server Management Studio are both awesome tools. That said, this month I have a challenge for you.

Scripting only.

Pretend like you are going to have to use sqlcmd, or the DAC (dedicated admin connection). You have no choice, you have to script rather than using a GUI to do the work for you. That means that if you need to take a backup you write a script. Want to see the list of databases? sys.databases. etc. Virtually anything can be done via scripting, and frequently you can do more, faster by scripting things out. Obviously don’t let this stop you from getting your job done. There are a few things that you are better off using the GUI. (Unless you decide to use PowerShell?) But can you force yourself to script? Spend a few extra minutes looking up that command you need?

I promise you it’s worth it. After some practice I can start a backup or restore many, many, many times faster with a script than I can with the GUI. (I mean assuming I’m not going to be restoring a couple hundred log files. Although to be fair, I can do that pretty quickly too.)

So. Challenge given! Do you accept?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 3,755 other subscribers

Follow me on Twitter

ToadWorld Pro of the Month November 2013
%d bloggers like this: