SQLServerCentral - www.sqlservercentral.com

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

Featured Contents

Featured Script

The Voice of the DBA

No Magical DevOps

I saw this comment in a post a short while back. A reader said "I'm still trying to wrap my head around "devops" as it pertains to database deployment. ... how do you deal with those potentially dangerous/destructive changes without manually coding? ... what tools are there that help in that regard? That's what database developers really need. The only tools I've found that' [are] useful so far are experience and care.

We have some tools over at Redgate software to help with database DevOps, but there aren't any magic solutions that can alter your database in some way that doesn't impact users and preserves all data. In fact, if anyone claimed to have a tool, I wouldn't trust it because there are just too many variables in database deployments. I certainly wouldn't trust a tool with automated rollbacks. Ultimately, experience and care are needed to build better software.

And, by the way, DevOps doesn't solve deployment issues. All DevOps does is help you automate the tasks you'd run manually in a reliable, repeatable fashion. DevOps teaches you to learn from your actions (gaining experience) and experimenting with small changes so that your mistakes aren't as impactful (developing with care). DevOps isn't magic, it's good, solid, learning from what works and what doesn't, altering our habits, and striving to be better. DevOps is often just providing a reliable, repeatable way of automating the things you do manually now, not inventing new processes.

I do believe in DevOps and I think that it can work well, but it requires balance, commitment, and huge culture changes. Automating code deployment is easy with some tools. Getting people to write better code is hard. I can help with the former, and I try to help with the latter here at SQLServerCentral, but it's really up to most of you to make an effort to become better at your craft. Getting that to work in any size organization requires that your management supports teams learning to be better and tolerating a few mistakes here and there.

Many successful developers and DBAs have been practicing for many years (even decades) what the media and high profile companies have been calling DevOps for mere months. You can join them by looking to improve all parts of your software development pipeline through collaboration and automation. Just don't forget to also learn to write better code along the way.

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

SQL Prompt

Write, format, analyze, and refactor SQL fast with SQL Prompt

Writing SQL is 50% faster with SQL Prompt. Your SQL code can be formatted just the way you like it, you can create and share snippets with your team, and with code analysis you get suggestions to improve your SQL as you type. Download your free trial

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

Featured Contents


Stairway to MDX - Level 4: The Order() Function: Beyond Cube Hierarchies

Bill Pearson from SQLServerCentral.com

Bill Pearson continues his examination of the versatile Order() function, focusing upon its use in providing dataset sorts that reach beyond dimensional hierarchies More »


How to Turn on Instant File Initialization

Additional Articles from Database Journal

Not having instant file initialization turned on slows down the process of adding pages to your database, because prior to allocating the data pages to your database, SQL Server needs to zero out the newly allocated pages. More »


Free eBook: Performance Tuning with SQL Server Dynamic Management Views

Additional Articles from Redgate

Dynamic Management Views (DMVs) are a significant and valuable addition to the DBA's troubleshooting armory, laying bare previously unavailable information regarding the under-the-covers activity of your database sessions and transactions. More »


The top 10 considerations when designing a data platform

Designing a data platform for a new product or service is a fascinating and exciting challenge. It’s also a daunting one. More »


From the SQLServerCentral Blogs - My Azure ARM template development workflow

Ed Elliott from SQLServerCentral Blogs

Writing infrastructure as code is pretty nice and I enjoy the declarative approach of defining what you want and letting... More »

Question of the Day

Today's Question (by Steve Jones):

I have this function I've built in R.

> mycoolfunction <- function(x)
+ { y <- x * 10
+ return paste("my favorite number is ", y) } 

What happens when I run this code?

> a <- 5:7
> sapply(a, mycoolfunction) 

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: R Language.

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

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

I have a table with a few rows in it.

ContactID FirstName
1         Tom
2         Peyton
3         Eli
5         Drew 

I have this code. What happens when I run this?

DECLARE @login VARCHAR(100);

SET @login = c.FirstName 
 FROM dbo.Contacts AS c

PRINT @login

Answer: An error is returned


The SET statement cannot work with multiple values being returned. In this case, an error is returned because there cannot be used in place of SELECT.

Ref: SET - click here

» Discuss this question and answer on the forums

Featured Script

Difference between dates displayed in days, hours, minutes and seconds

Robinson Pingus from SQLServerCentral.com

-- Mostrar una diferencia de solo fechas
SELECT dbo.ufn_DifferenceBetweenDateTimes('2017-10-03 00:00:00', '2017-10-12 00:00:00')
-- Return: 9d 00:00:00
-- Mostrar una diferencia en minutos
SELECT dbo.ufn_DifferenceBetweenDateTimes('2017-10-05 07:30:00', '2017-10-05 07:55:00')
-- Return: 0d 00:25:00
-- Mostrar una diferencia en la misma fecha
SELECT dbo.ufn_DifferenceBetweenDateTimes('2017-09-01 01:46:00', '2017-09-01 10:55:00')
-- Return: 0d 09:09:00
-- Mostrar una diferencia de dias
SELECT dbo.ufn_DifferenceBetweenDateTimes('2017-11-21 08:21:00', '2017-12-06 18:00:00')
-- Return: 15d 09:39:00

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

dsa.msc to find a service ac part of (member of) which groups - Hi, Using dsa.msc is an easier manual way to find any service ac / user part of (member of) which groups? What is...

SSMS 17.3 Start Powershell give s error - No SQL Server cmdlets found on this computer - This is a Win 10 desktop and I've installed the sqlserver module via install-module sqlserver -force. I can import it...

SQL Server 2017 : SQL Server 2017 - Development

SQL Server Over Partition - Notes:  Column A is not a dollar figure but a limit payed out. When column A is 0 it indicates a...

SSMS 17.4 - Find & Replace - In SSMS 2014, I used +$ (using RegEx) to find trailing spaces, and replace them with an empty string. In SSMS 17.4,...

SQL Server 2016 : SQL Server 2016 - Administration

Backup failures - Backups are failing with below errors. Any suggession please. Thank you !! Message Executed as user: XXXX\SYSTEM. ...ersion: 13.0.4001.0 Edition: Enterprise Edition: Core-based Procedure:...

Splitting TempDB across multiple files - I have a question regarding the splitting of TempDB in SQL Server, I know its a must in production environments...

Need to put large database into norecovery state - Hello, I have two servers in an Availability group.  Servers A is primary and Server B is secondary. For some reason, the...

Transactional replication - which articles caused the failure - Hi I have a Push Transactional replication process. I use the GUI to add multiple stored procs as articles. But during...

Multiple AG groups in one Windows failover cluster? - In an organisation I found the following setup:  Six VMs SQL1 to SQL6 in the same domain, each host two instances....

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

Row inserts for groups of rows (Totals for groups of like data). - I want to group data like all invoices from a supplier which is easy enough but when selecting multiple suppliers,...

Case sensive search using IN in a case statement. - Below is my code. I need to search on 5 terms. The example givin, it is pulling rcords with 'APPROVED'...

Find a sub string in a column based on values in a reference table - Good morning,    I am not quite sure how to approach the problem. I have a table for customer and vendor...

SQL Server 2014 : Administration - SQL Server 2014

Unable to update SQL Server 2014 instances - Error code: 1625 - We have made various attempts to update two of our SQL Server 2014 instances, but the update errors on every...

Extended Events captures query_hash/query_plan_hash to 0 in some queries - Extended Events captures query_hash/query_plan_hash to 0 in dynamic query sometimes, anyone knows why? thanks! XE:

SQL Server 2014 : Development - SQL Server 2014

create procedure gets stuck on select - CREATE PROCEDURE sp_cenik as begin DECLARE @OD DATETIME, @DO  DATETIME, @TipSobe VARCHAR(6), @KodaCenika  INT, @Sezona   INT SELECT @Od = :a2, @Do  = :a3, @TipSobe = :a1, @KodaCenika = :a4; I get: "Msg 102, Lev

SQL Server 2012 : SQL Server 2012 - T-SQL

How to get up to 5 hierarchy levels of data from original (parent) to derived (children) product table. - I have a table with 3 columns: Id (identity),Sku_Parent (varchar(10)),Sku_Child (varchar(10)) I would like to get help to write a recursive...

SQL Server 2008 : SQL Server 2008 - General

Only show the latest date in a selection of data - Hi there everyone I'm having problems using the MaxDate function in SQL and wondered if you could please help me? I have...

Database Design : Relational Theory

Is My Foreign Key Table Unnecessary? - I'm sure this has been addressed many times here but none of the search terms I've tried have surfaced anything...

SQL Server 2005 : SQL Server 2005 General Discussion

rounding up to the next whole number - I'm trying to round a number up to the next whole number in sql server 2005 query analyzer. i.e. 12.2 needs...

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