SQLServerCentral - www.sqlservercentral.com

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

Featured Contents

The Voice of the DBA

The Full Court CosmosDB Press

This year at the PASS Summit, Dr. Rimma Nehme (b|t) will give another keynote address. She has spoken at a number of previous Summits, and is a very popular speaker. This time her topic is CosmosDB, which is where she's been working at Microsoft for some time. I was lucky enough to see Dr. Nehme at Build 2017 talk some CosmosDB, and I'm sure she's got more to say this now.

Actually, I've been a bit surprised by all of the writing about CosmosDB that I see taking place. Perhaps it's that the CosmosDB Twitter account is very active, but it seems that so many .NET developers and other non-SQL Server professionals are talking about how they are building projects and platforms on CosmosDB. I follow plenty of SQL people, but it seems there is a tremendous amount of activity on CosmosDB (and R/Data Science), more than I see with plain old SQL Server (POSQL?).

When I first saw DocumentDB, the forerunner of CosmosDB, I thought it was a good platform for some workloads. Certainly the heavy write a document, read the same thing of the XBOX profiles and some of their games seems like a good use of the technology. When they added MongoDB, I was slightly more interested, but still not a lot. I really haven't seen many workloads that seem to exceed what SQL Server can do in a relational platform. At least, not if you write efficient code and buy enough hardware. The change to CosmosDB, however, was really interesting. Allowing graph APIs, key values, and documents in one service is something I am sure is attractive to many developers. Especially the heavy use of JSON, which seems to be a format many developers prefer over datasets.

I know Microsoft would like more people to use CosmosDB as it's completely a PaaS, pay-as-you-go service, and that could easily increase their revenue if they can get many people using the product. The have invested quite a bit into the platform, with latency guarantees, multiple consistency models, and plenty of scalability. It's certainly on my list of topics to dig more into how CosmosDB works and where it might be applicable to solving data problems.

I think there are applications where a CosmosDB datastore will work well, but I wonder if this is more of just a front end, gather data service, that will require additional databases behind the service were data can be combined and aggregated for other reporting. I don't know that querying your graph tables alongside key-values and documents will be as easy as it might be in a relational system, but hopefully we'll see some people (perhaps me) experimenting and reporting back on the complexities and advantages of such a datastore.

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

Don’t just fix SQL Server problems, prevent them from happening

SQL Monitor helps teams looking after SQL Server be more proactive. Not only does SQL Monitor alert you to current issues, it gives you the information you need to stop them happening in the future. Download SQL Monitor now and get a 14 day free trial


Using SQL Census to audit SQL Server permissions

Redgate have just released SQL Census, a prototype tool that makes auditing SQL Server user access permissions much easier. In this post, Santiago Arias talks us through the brand new Server View feature, tells us what's up next in the tool's development, and explains how you can download it for free. Try the free prototype

Featured Contents


The Instance ID MSSQLSERVER Is Already In Use

Nisarg Upadhyay from SQLServerCentral.com

This article will explain how to fix "The Instance ID 'MSSQLSERVER' Is Already In Use By SQL Server Instance 'MSSQLSERVER.INACTIVE' Error. More »


How to Drop All Your Indexes – Fast

Additional Articles from Brent Ozar Unlimited Blog

You probably shouldn't be doing this, but if you need to, Brent Ozar has a script for that. More »


Redgate wants your opinion

Have you tried or used SQL Prompt? Redgate is running some research on SQL Prompt pricing. Please help by filling in their short survey for the chance to win one of three licenses of SQL Prompt or a Redgate point-tool if your choice. More »


From the SQLServerCentral Blogs - Please Don’t Do This!

mrathbun from SQLServerCentral Blogs

Please, please, please Admins do not leave your default index fill factor at 0. This means you are telling SQL... More »


From the SQLServerCentral Blogs - DevOps Basics–Git Clients

Steve Jones from SQLServerCentral Blogs

This is also a part of a basic series on git and how to use it. There are lots of git... More »

Question of the Day

Today's Question (by Steve Jones):

At Redgate, we sometimes owe each other beers for mistakes or insults rendered to another. I've got a table with a number of items being tracked.

Since we need to settle up tonight, who is owed the most net beer (owed - owes)? 

WITH myBeers
(SELECT OwedTo, OwedBy, EarnedDate, Beer
('Bart','Steve', '2017-01-25', 4),
('Bart','Andrew', '2017-01-28', 2),
('Andrew','Rob', '2017-08-20', 1),
('Bart','Andrew', '2017-05-08', 2),
('Ally','Tony', '2017-02-05', 2),
('Tugberk','Dave', '2017-05-28', 2),
('Dave','Tugberk', '2017-06-17', 3),
('Bart','Steve', '2017-02-18', 4),
('Bart','Andrew', '2017-06-19', 2),
('Tugberk','Dave', '2017-08-17', 2),
('Tony','Bart', '2017-01-29', 3),
('Andrew','Rob', '2017-08-10', 1),
('Tugberk','Bart', '2017-04-12', 3),
('Bart','Steve', '2017-05-11', 4),
('Bart','Steve', '2017-03-28', 4),
('Andrew','Rob', '2017-02-06', 1),
('Tony','Bart', '2017-04-26', 3),
('Tugberk','Bart', '2017-03-01', 3),
('Rob','Ally', '2017-08-29', 1),
('Bart','Steve', '2017-03-02', 4),
('Rob','Ally', '2017-09-02', 1),
('Bart','Steve', '2017-03-09', 4),
('Ally','Tony', '2017-08-06', 3),
('Bart','Andrew', '2017-06-01', 2),
('Bart','Steve', '2017-05-12', 4),
('Andrew','Rob', '2017-06-02', 1),
('Dave','Tugberk', '2017-03-15', 3),
('Dave','Tugberk', '2017-04-11', 3),
('Tugberk','Bart', '2017-04-10', 3),
('Tugberk','Bart', '2017-06-29', 4),
('Dave','Rob', '2017-03-09', 1),
('Bart','Andrew', '2017-03-26', 2),
('Tony','Dave', '2017-04-11', 1),
('Bart','Steve', '2017-04-20', 4),
('Tugberk','Dave', '2017-02-10', 1),
('Bart','Andrew', '2017-08-27', 2),
('Rob','Tony', '2017-04-05', 3),
('Dave','Tugberk', '2017-04-15', 3),
('Andrew','Dave', '2017-02-03', 1),
('Tugberk','Bart', '2017-05-06', 4),
('Rob','Tony', '2017-07-27', 3),
('Bart','Andrew', '2017-07-16', 2),
('Bart','Steve', '2017-03-12', 4),
('Bart','Steve', '2017-06-06', 4),
('Andrew','Bart', '2017-06-30', 3),
('Dave','Rob', '2017-01-15', 1),
('Bart','Andrew', '2017-03-03', 2),
('Andrew','Dave', '2017-04-23', 1),
('Tugberk','Dave', '2017-04-24', 2),
('Steve','Tony', '2017-06-08', 2),
('Tugberk','Bart', '2017-02-02', 3),
('Tony','Bart', '2017-01-29', 3),
('Tony','Bart', '2017-03-30', 3),
('Bart','Steve', '2017-02-09', 4),
('Ally','Tony', '2017-06-09', 3),
('Tony','Bart', '2017-02-11', 3),
('Andrew','Rob', '2017-01-15', 1),
('Tugberk','Dave', '2017-03-14', 1),
('Rob','Tony', '2017-04-25', 3),
('Dave','Tugberk', '2017-02-01', 3),
('Tony','Bart', '2017-09-04', 4)

) a(OwedTo, OwedBy, EarnedDate, Beer) ) SELECT * FROM myBeers

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.


Exam Ref 70-761 Querying Data with Transact-SQL

Prepare for Microsoft Exam 70-761–and help demonstrate your real-world mastery of SQL Server 2016 Transact-SQL data management, queries, and database programming. 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 from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

I have created a list in Python like this:

>>>mylist = []

I want to add an element to the list. What syntax will add the string, "Porsche", to the list?

Answer: mylist.append("Porsche")


The append method is used to add elements to a list.

Ref: Append - 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 2016 : SQL Server 2016 - Development and T-SQL

Convert Teradata CASE to t-SQL CASE with CAST and an Operator - Hello, I've got a Teradata Case statement, and I'm trying to convert it to a T-SQL Case statement, and I...

SQL Server 2014 : Administration - SQL Server 2014

Transaction Logs - Hello. I have  lot of DBs that have very large transaction Log files and some have a huge number of VLFs. We...

Arithmetic overflow error converting IDENTITY to data type int - int to bigint questions - Hi, I recieved this error: Arithmetic overflow error converting IDENTITY to data type int I believe I need to change my datatype from...

Server Side SSL SQL Network Encryption - selfsign cert - why is it working ? - Hi all, In BO, it is emphasize that using self-sign cert promotes MITM attacks and we should use CA/Internal CA signed...

High Memory consuming by Database - Hello Everyone, I have a database which size is 250 GB and it contains the information about 70 Lak users with...

SQL Server 2008 : SQL Server 2008 - General

Fill Factor on Clustered Index - Dear Experts, When creating a clustered index , does it matter how much are the updates done and then decide on the fill...

Occasional mysterious time outs on SQL Server db table - Hi there, We have users in the field who use a mobile web GIS application (using Java) which use forms to edit/update spatial...

Data Warehousing : Integration Services

Package Performace Tuning - I have a 2016 ver tab cube in a 2016 ver instance, being loaded by a 2016 ver SSIS package...

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