SQLServerCentral - www.sqlservercentral.com

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

Featured Contents

The Voice of the DBA

The Relational Database is the Default

It seems that I regularly meet people in the SQL community that are asked about moving their datastore to a NoSQL type of database. In a mature system, that might be a conversation worth having, especially if there are issues with handling the workload. I doubt there are many type of workloads that I would think are worth moving, but perhaps some exist. However, the discussion about moving is one you can have, given your understanding of the deficiencies you see in your datastore.

Often I often find is a different story for new applications.  Often I hear about developers becoming enamored with a datastore, a simpler one than SQL Server or some other RDBMS, and look to MongoDB, Cassandra, Hadoop, Neo4J, etc. as the shiny, new, exciting choice. They think NoSQL offers an easier way to build their application, where they can throw and grab JSON through an API, while changing their minds on the ways in which they need to handle data.

They approach a new application like a startup would, using some exciting technology that has just proven to be successful by some hot company in the news. They look forward to developing an application that other developers will be jealous of next year. Or they just want to use something new that's being written about on blogs and spoken about at conferences. Or they just want to do something more interesting on the next project. All these might be great approaches, and certainly are ways that make one's job more engaging. 

However. Just as this piece notes, choosing a new datastore because it's new and exciting, and not because it fits the data model is a mistake. The data model matters, often because this is the permanent output of your software application. The data will live on and needs to meet current and future needs, separate from the amazing Node.JS framework of the week that your users love. Actually, users don't love your framework. They love your work. Whether it's MVC, Angular, Django, or Dapper, most clients could care less. Any language/framework/platform can build an application that works well for clients. Your application just has to work.

Relational databases work really, really, really well. They handle most problem domains well, with protection against common consistency errors, and they have plenty of features that help you build a solid data model. There are tips and tricks to migrate your schema to some new form if you need to. However, if you need to migrate your schema every few days, you haven't really thought about the schema. As the article notes, you need a schema. On read, on write, or both, you're not getting away with ignoring schema.

And by the way, if you keep your schema in Python or C# or some other language, you're likely creating a set of "legacy code" that will haunt you for years and is much harder to manage than database schema migrations. Maybe it feels less risky, but it's probably way less fun to work on.

Databases are a pain to work with. I get that. It's so much more cumbersome than refactoring C# classes on the fly. Databases have a different job, and they do it well. If you have a good reason to choose some other datastore that's related to your problem domain and data model, then go ahead and choose something else. If you don't, then use SQL Server (or PostgreSQL, Oracle, etc.). Most of you won't, so just stick with relational databases. You might not thank me, but your organization and future developers will.

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 ( 4.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.

SQL Prompt

Could your SQL coding be more efficient?

Data Platform MVPs and SQL Server experts share their tips on how to standardize formatting whilst stripping out the repetition of coding with SQL Prompt. Over these 20 short videos we will help you write better, shareable SQL faster. Check out the tips


Database migrations inside Visual Studio

Feeling the pain of managing and deploying database changes manually? Redgate ReadyRoll creates SQL migration scripts you can use to version control, build and release, and automate deployments. Try it free

Featured Contents


How to store Excel files In SQL Table

Nisarg Upadhyay from SQLServerCentral.com

This article will show how to store images, document and all other files in SQL Table. More »


SQL Server R Services: Working with Multiple Data Sets

Additional Articles from SimpleTalk

Although it is easy to use SQL Server R Services to create R scripts that incorporate SQL Server data by passing in a T-SQL query as an argument when calling the sp_execute_external_script stored procedure, you are limited to that one query, unless you pass additional data directly between R and SQL Server via CSV files. It is simple to do, and opens up many additional opportunities for data analysis. Robert Sheldon explains how. More »


Major new study reveals the true ROI of database DevOps

Redgate has launched a new research study that reveals the benefits different stakeholders can expect from DevOps, and provides a powerful methodology for calculating the ROI of database DevOps. More »


From the SQLServerCentral Blogs - Closing all of the connections to a database

Kenneth Fisher from SQLServerCentral Blogs

Doing a database restore may not be the most common task a database professional will ever do, but it’s a... More »


From the SQLServerCentral Blogs - Watch Out for Automap in SQL Compare

Steve Jones from SQLServerCentral Blogs

I wrote a piece on SQL Compare and customizing the Automap feature. This was handy for me in a small... More »

Question of the Day

Today's Question (by Evgeny Garaev):

What ts the result of this script executed on SQL Server 2016?

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: T-SQL.

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


Expert T-SQL Window Functions in SQL Server

Expert T-SQL Window Functions in SQL Server takes you from any level of knowledge of windowing functions and turns you into an expert who can use these powerful functions to solve many T-SQL queries. Replace slow cursors and self-joins with queries that are easy to write and fantastically better performing, all through the magic of window functions. Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

I have loaded a data frame from a CSV with this code:

gdpvalues = read.csv("h:\\downloads\\gdp2.csv")

Unfortunately the file doesn't have a header row. Right now I see this in R Studio:

I want to add column names to the data frame. What code can I run?

Answer: colnames(gdpvalues <- c("Code", "Rank", "Country", "Pop")


The code that works is:

colnames(gdpvalues <-  c("Code", "Rank", "Country", "Pop"))

This assigned the combined vector of names to the various columns in the data frame.

Ref: Colnames - 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 - Administration

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...

Import 2014 Registered Servers - My dev box was replaced on Friday, as SQL 2016/2017 would not install on Win7. I have just finished installing SQL 2017,...

SQL Server 2017 : SQL Server 2017 - Development

FAST_FORWARD cursor slow for simple SELECT COUNT(*) because sp_cursorfetch() re-scans all index - Hi all, We are using MS ODBC 13 (on Linux) to execute a simple SELECT COUNT(*) FROM table query... This query is...

INDEX MATCH IN SQL.... IS IT POSSIBLE?? - Mail – craig.jenkins@monmotors.com                                             &

SQL Server 2016 : SQL Server 2016 - Administration

Newbie point-in-time restore question - Hello experts, I have the following scenario and am wondering if someone can confirm the steps for me. I know how to...

Agent Job fails on "sa" account login - I have a couple of SQL Server Agent jobs configured to run as "sa" However, they fail with the error "Description:...

Slow query - client or server issue - If seeing a client make a regular query that uses the same plan but completes in radically different times on...

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

Question about the GO statement - Hi, I know that using "GO 9" for example will execute a batch of T-SQL commands 9 times. E.g. /* this block...

Sorting after records deleted - CREATE

Flat file connection manager - I'm creating a flat file with a fixed length of 490 characters. Here's a snapshot from the Advanced page in...

SQL Server 2014 : Administration - SQL Server 2014

VBscript to run sql file from MS SQL - Hi, I am digging arount internet and the solutions are not working for me. I am looking to connection to MS SQL...

Bulk insert into table from csv - Hi, i have table in CSV: As you can see there are a lot of columns.  My source table data types fields are:

MSSQL Schema Export Only - Is there an easy way to do schema only exports in mssql

SQL Server 2012 : SQL Server 2012 - T-SQL

Next date after a return date. - Hello Our company is in the garment hire business so we have items on an order that go out and then...

Split out data from single field that is encoded with new lines - I have a table with one field that merges all notes entered from an application into a single varchar(MAX) field. ...

SQL Server 2008 : SQL Server 2008 - General

Remove duplicate values - Hi Experts, In the below table records are grouped by ID column. If the count for ID is greater than 1 then...

Transactional Replication :: Error Creating New Publication - Attempting to create a new publication and received this error: TITLE: New Publication Wizard ------------------------------ SQL Server could not create publication 'XX_TABLES'. ------------------------------ ADDITIONAL INFORMATION: An...

SQL Server 2008 : SQL Server Newbies

Can we restore copy-only full backup and regular tlog backup? - Good Morning Experts Can we restore copy-only full backup and regular tlog backup?

find out what transaction caused the log file to become full yesterday or day before yesterday - Good Morning Experts,An application job has been failing repeatedly with below error from last 3 days. Is there a way...

SQL Server 2005 : SQL Server 2005 General Discussion

Retrieving column and table names used in a stored procedure - Does anyone know if it's possible to retrieve the column and table names being used by a stored procedure, and...

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 ©2017 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com