SQLServerCentral - www.sqlservercentral.com

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

Featured Contents

Featured Scripts

The Voice of the DBA

The New DBA is a Developer

I was reading a short piece from Mike Fal recently and it struck a chord with me. I started working with computers as a developer, really a hack programmer as a kid. Friends and I would build small games or hack existing ones to change things. Eventually I was paid to write code, and moved into data work because the pay was better. That was 25 years ago, and I haven't regretted the change since. In fact, I've enjoyed working with data.

Even as I managed data, I always ended up writing some code. Not code, code, like an application that others could use to accomplish a task (though I have often done a touch of that), but rather code to help me as a DBA. I had code to check servers and record values. I had code to move backup files around and generate restore scripts. I had code that would build reports for other DBAs. Some of this code are queries, some are more complex scripts in PoSH (or older VBScript), some could be C# or some other language, but it's all code. Fundamentally, the code isn't much different from the code that application developers write and deploy to clients, web servers, or mobile devices.

There always seemed to be a separation between a DBA that could script something and a DBA limited to simple DML queries. The latter was much less efficient, less productive, less capable of managing a larger environment. As I look to the future, I'd say that that DBA or sysadmin that can't write some code, that is mystified by the concepts of Puppet, Chef, or even unattended SQL installs, is less likely to find good paying, enjoyable, desirable employment. There will be exceptions and less capable people will find work, but given a choice, I think businesses will prefer to get the coding DBA.

Mike brings up great points in his piece, and despite my history as a developer, I've build bad habits over the years. I used to carry around a CD, then a flash drive with helpful DBA scripts on it. I didn't always have a good test process. Part of this was the lack of good modern tools, part was laziness, but just like Mike, I've started to think of anything I do as an effective developer would. I make sure things get done, and I don't try for 100% solutions. I try to get something working, find the problems and fix them, adjusting as I learn and the system changes. I try to build unit tests and ensure that as I change code, I'm not introducing silly bugs because I'm focusing on today's issue while neglecting the requirements I had to meet last week.

Above all, I use version control. That should be a no-brainer for a DBA. We preach backups and restores all the time. Why should our code be any different? These days I've adopted git and I use it extensively. Whether on Github or VisualStudio.com, I'm ensure I've got my code backed up, and practice restoring regularly on other machines. I create repos as soon as I create a folder to work in, and commit regularly. I don't revert often, but when I do, it's nice to have that backup in my VCS.

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 ( 7.0MB) 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.

ADVERTISEMENT
SQL Search

Free SSMS add-in: SQL Search

Redgate SQL Search is a free SSMS add-in that lets you find fragments of SQL across multiple objects and multiple databases. Once installed, SQL Search appears on the SSMS toolbar, allowing you to quickly navigate to objects wherever they are on a server. Download SQL Search now.

SQL Source Control

How to track every change to your SQL Server database

See who’s changing your database, alongside affected objects, date, time, and reason for the change with SQL Source Control. Get a full change history in your source control system. Learn more.

SQL Monitor

SQL Monitor - Always have the answers to SQL performance issues

SQL Monitor keeps an eye on your SQL Servers 24/7, so you don't have to. It helps you proactively monitor the performance of your SQL Servers, saving you time, and makes sure you always have the answers to tough performance problems. Find out more.

Featured Contents

 

Azure SQL Data Warehouse with PowerShell

Daniel Calbimonte from SQLServerCentral.com

We will teach how to create a new SQL Azure Data Warehouse using Powershell More »


 

DevOps and Database Lifecycle Management

Additional Articles from SimpleTalk

Database Lifecycle Management (DLM) aims to provide a roadmap of what is required, and when, to deliver and maintain effective databases that can respond quickly to business change. How does the DevOps movement, as it applies to databases, fit into this? William Brewer explains how DevOps provides the organisational change between delivery and operations to make important parts of the process easier to introduce. More »


 

From the SQLServerCentral Blogs - Creating a connect entry.

Kenneth Fisher from SQLServerCentral Blogs

I recently wrote a blog about how to tell why your SQL login isn’t working. There were a lot of... More »


 

From the SQLServerCentral Blogs - Transaction log shipping in SQL Server on Linux

Andrew Pruski from SQLServerCentral Blogs

SQL Server on Linux has been out for a bit now and I’ve played around a little (see here) but... More »

Question of the Day

Today's Question (by Steve Jones):

What are the modes I can choose for transactions commiting (availability mode) between Availability Groups in SQL Server 2016 in the ALTER AVAILABILITY GROUP command?

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: always on.

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

ADVERTISEMENT

SQL Server Hardware will provide the fundamental knowledge and resources you need to make intelligent decisions about choice, and optimal installation and configuration, of SQL Server hardware, operating system and the SQL Server RDBMS.

Pick up your copy of this great book from MVP Glenn Berry at Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

There are a number of enhancements in SQL Server 2016 that speed up the instance and improve performance. What is an improvement on the secondary that helps keep the secondaries in sync with the primary?

Answer: spin up multiple LogWriter threads and perform redo in parallel

Explanation:

One of the improvements in SQL Server 2016 is the parallel redo on secondaries with multiple threads.

Ref: What's New in SQL Server 2016 (Database Engine) - High Availability - https://msdn.microsoft.com/en-us/library/bb510411.aspx#HighAvailability

SQL Server 2016 – It Just Runs Faster: Always On Availability Groups Turbocharged - https://blogs.msdn.microsoft.com/sqlserverstorageengine/2016/09/26/sql-server-2016-it-just-runs-faster-always-on-availability-groups-turbocharged/


» Discuss this question and answer on the forums

Featured Script

Query details about objects allocated in TEMPDB.

Eric Russell from SQLServerCentral.com

TEMPDB doesn't have to be a black box. Know what objects and processes are causing it to bloat in size. This query will return details about objects currently allocated in TEMPDB. It includes: table name, create date, allocated MB, row count, and the spid, login name, application name, etc. that allocated it.

Based on feedback, this updated version uses tempdb (lowercase) to compensate for servers with case sensitivity enabled. Also I have extended it to include the stored procedure name and SQL statement (if applicable) that allocated the object.

More »

Featured Script

Find Text in All Databases

Jason Givens from SQLServerCentral.com

This script is useful when you need to find all references to something such as a table, view, stored procedure, linked server, or any other object, on a SQL Server.  This script is not the most efficient code but it gets the job done in those times when you simply need to get the job done and it is not a frequent job.  It can also take a littl while, depending on the number of databases on your SQL Server and the number of objects in each database. 

We use this script when we need to move databases, such as for an upgrade, or when we need to change linked server references, or when we are trying to determine if particular objects are still being used\referenced.

This script will allow you to enter a search term and it will search through all of the objects, in all databases on the SQL Server, to find any references to that search term.  To set the search term, simply set the value for the @search_string variable.  This code looks like the following:

-- Set the search string
SET @search_string = 'mytext'

All results are place in a temporary table and the contents of that temp table are returned.  You can modify the temp table query as you like to filter your results.

There is a comment in the code that identifies the type of objects that are searched but here is the list:

D       DEFAULT (constraint or stand-alone)
P       SQL Stored Procedure
RF     Replication-filter-procedure
V       View
TR     SQL DML Trigger
FN     SQL scalar function
IF      SQL inline table-valued function
TF     SQL table-valued function (2012 - 2016)
R       Rule (old-style, stand-alone)

More »

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 2014 : Administration - SQL Server 2014

Migrate a single database from physical to VM and from SQL 2005 to SQL 2014 - Hello, I'm planning to migrate a single database from SQL 2005 to SQL 2014 from physical to VM. I checked the...

Execution plan estimates Join hint spilling. - Hi, I've been troubleshooting a performance problem with a stored procedure where depending on the parameters the row count on two...


SQL Server 2014 : Development - SQL Server 2014

Issue with while loop - I have a while loop simple loop - where I am retrieving 10000 records. When I ran in sql server - it has...


SQL Server 2012 : SQL 2012 - General

Transaction questions - There are three store procedures. Each sp will get parameters from a asp.net project. Each sp will updat database. I applied transaction...


SQL Server 2012 : SQL Server 2012 - T-SQL

Parent child hierarchy - Hi, I want the TaskName field to show Hierarchy in the order with further indentation of the child .       + SuperTask        -- SubTask        ...


SQLServerCentral.com : SQLServerCentral.com Website Issues

Better way to report spam - I like the look of the new layout for the forums, but I see that there still seems to be...

This email has been sent to newsletter@newslettercollector.com. 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 ©2015 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com