SQLServerCentral - www.sqlservercentral.com

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

Featured Contents

The Voice of the DBA

Single Source of Truth

Today we have a guest editorial as Steve is traveling.

I’d like to think that most enterprises and all developers get the value of having a single source of truth, though of course only us data people really get it. We’re comfortable with the concepts of normalization, have experienced the pain of denormalizing, have researched more than once the question of ‘why doesn’t this report match that report’, and we get that data is rarely pristine. Even if imperfect, having a single source of truth is a really important thing.

For many people, and especially for us data people, describing the single source of truth has an easy answer - the database. We capture OLTP data in it, then we might copy it directly or in some transformed way to reporting servers, data warehouses, search engines, and more, always knowing that while it’s all supposed to be equivalent that sometimes it is not. However, we can figure it out by going back to the database. We also know that as long as all reports are based on the same copy of the truth that all the reports should match (even if they are wrong!).

Does that mean the source of truth has to be in the database? Or more nuanced, does all of the the truth have to be stored in the database?

It’s tempting to say yes. Oh, it is tempting. But practical? Not if you want to leverage external systems and providers. One example might be a CRM application. Does the sales team enter prospects and new customers in the CRM app and have them propagated to the database? Or does it get entered in the database and then pushed into the CRM app? Another example might be if you use an email service like SendGrid. They know how many messages bounced so you have to get that particular truth from them. Yes you can pull into the database and treat it like truth, but if there is ever a doubt about the numbers, the database is not the single source of truth for that particular data point.

The net of all this is that having a single source of truth is critical and it doesn’t mean it all has to be in the same place. I think that’s an important reminder for those of us whose view of the world is database centric. The goal is to have a single truth for each datapoint, if we can achieve that then we can make decisions about whether to copy that data somewhere to simplify usage or to mash it all up at a layer above the database.

Andy Warren from SQLServerCentral.com

Join the debate, and respond to today's editorial on the forums

ADVERTISEMENT
GDPR

How to make your SQL Server development GDPR ready

Redgate’s SQL Data Privacy Suite helps you to build a data catalog of your SQL Server estate, and put in processes to protect and monitor personal information. Find out more about how our tools help with GDPR compliance

Webinar

How to monitor hybrid and cloud-based SQL Server estates

As organizations move to hybrid or cloud estates, the perception is that monitoring those servers gets more complicated, particularly if you have different servers on different platforms. In this webinar we will show you that it is quite easy to keep track of your databases and servers, regardless of where they are hosted, thanks to SQL Monitor.
Register now

Featured Contents

 

SSIS Basics: Bulk-Import various text files into a table

Eduardo Pivaral from SQLServerCentral.com

For this post I will show you how to bulk insert multiple files in a folder to a SQL Server database, regardless the file name or extension, this with the help of the ForEach Loop Container. More »


 

Databases with MAXSIZE Set

Additional Articles from Database Journal

When a database grows to the MAXSIZE the database will not grow anymore and if someone tries to add more rows they will get an error saying the database is full. Greg Larsen shows you how to find all database files that have their max_size set. More »


 

How to Detect SQL Injection Attacks using Extended Events and SQL Monitor

Even if all precautions have been taken to prevent SQL Injection attacks, as laid out in the OWASP website, it is still wise to be able to detect if an attempted attack is taking place, and it is essential to know if such an attack is successful. More »


 

From the SQLServerCentral Blogs - No More Mysterious Truncation

Steve Jones from SQLServerCentral Blogs

If you read the Microsoft White Paper on SQL Server 2019, there’s a gem buried on page 17. It mentions... More »


 

From the SQLServerCentral Blogs - Power BI Custom Visuals Class (Module 118 – Stacked Bar Chart by Akvelon)

Devin Knight from SQLServerCentral Blogs

In this module you will learn how to use the Stacked Bar Chart by Akvelon. This version of the Stacked... More »

Question of the Day

Today's Question (by Steve Jones):

I have this table:

 CREATE TABLE UserConfig ( UserConfigKey INT IDENTITY(1,1) NOT NULL CONSTRAINT UserConfigPK PRIMARY KEY , UserID INT , IsActive BIT SPARSE , IsSubscriber BIT SPARSE , DefaultQuantity INT SPARSE , Options XML COLUMN_SET FOR ALL_SPARSE_COLUMNS ) GO 

I decide to add data like this:

 INSERT dbo.UserConfig ( UserID , Options ) VALUES (8, '<IsActive>0</IsActive><IsSubscriber>0</IsSubscriber><DefaultQuantity>0</DefaultQuantity>') 

What happens?

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: Column Sets.

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

Exam Ref 70-774 Perform Cloud Data Science with Azure Machine Learning

Prepare for Microsoft Exam 70-774 and help demonstrate your real-world mastery of performing key data science activities with Azure Machine Learning services. Designed for experienced IT professionals ready to advance their status, Exam Ref focuses on the critical thinking and decision-making acumen needed for success at the MCSA level.  Get your copy today from Amazon.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

The QUOTENAME() function takes a string as an input. What is the size limit for the input string?

Answer: 128 characters

Explanation:

The length of the string is limited to 128 characters. You can test this with this code. Try it with 128 and 129 as the REPLICATE() parameter.

 DECLARE @SomeVar VARCHAR(2000) = REPLICATE('a',128); SELECT QUOTENAME(@SomeVar) 

Ref: QUOTENAME - 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 - Development

More than one check constraint per column? - In the documentation for CREATE TABLE (Transact-SQL), under check constraints, I see: A column can have any number of CHECK constraints,...

Init-cap the characters in SQL server - Hi Sir, How to Init-cap the characters in SQL server in SQL query without creating any function? create table abc (Month_Name nvarchar(10)) [code...

What Steps Woud You Take: Inserting 200,000 records - Hello guys, I'm a novice. I need to create a stored procedure to insert 200,000 records into an existing table from...


SQL Server 2016 : SQL Server 2016 - Administration

Replication setup - Dear All, I want to set up Replication between 2 different versions of SQL Server, I want to know how much...

Transfer of system base from 2008R2 to 2014 - Hello ,Following a migration error of my SQL2008 server to 2014 I am starting from a new installation 2014 the goal...

Tab issues using SSMS solutions. - Hello everyone. I have a problem. Please, help me :) I use Microsoft SQL Server 2016 and SSMS 17.3 I start new...


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

BCP process count - Hello, I just want  to insert bcp process count value into table. I know we can get it in out.log file...

Validation of a complete error trapping process - Hey Everyone, This is the basic stored procedure error processing and capture routine I have in place. Any holes to poke...

Select Query Assistance (Comparison) - I am modifying a Query I have.  (I am using dummy data below as the set i have is quite...

Understanding the numeric and decimal data types - I am testing various values to better understand the numeric and decimal data types.  First I believe they are the...

Algorithm to combine 2 integer into one value and then disintegrate back into two - Hi, I may not be the first one to ask this, but I'm looking to find a way to combine two...

Best practice dealing with dead columns in dimensions - Good day, my question is if there is a way to deal with user related slow performance in Excel in pivot...


SQL Server 2014 : Development - SQL Server 2014

How to flip tables in sql server 2014 - Hello, I have a requirement wherein there are 2 tables (Staging & Target) in the same database. Everytime data is first loaded in...


SQL Server 2012 : SQL 2012 - General

General audit / monitor question - Just an FYI: I don't need code. I just need thoughts. This is me spit-balling. I need to come up with...


SQL Server vNext : SQL Server 15 - Administration

Performance concernce - Just ran through a handful of test harnesses, not impressed, vNext is more like vLast :cool:


SQL Server 2008 : T-SQL (SS2K8)

sp_RefreshSQLModule run on a view completely changed the view definition - SQL Version: Microsoft SQL Server 2008 R2 (SP3) - 10.50.6000.34 (X64)     Aug 19 2014 12:21:34     Copyright (c) Microsoft Corporation     Standard Edition (64-bit) on...


Reporting Services : SSRS 2016

Using HTML files as resources in SSRS no longer works after SP2 - We had an .html file that was uploaded to our SSRS instance that we used as a shortcut for users...


Data Warehousing : Integration Services

For loop for I reachable sql servers - I am able to loop through a list of sql servers and capture information but how do I tackle a...


SQLServerCentral.com : Suggestions

Link account to multiple email adresses - Just curious if anymore thought has been given to this idea?  Have it set up similar to how LinkedIn does...


SQLServerCentral.com : Articles Requested

Column in Key v Include - An article that looks at whether there is a reason to include a column as an index key or as...

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