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

I Feel Like a Magician

This editorial was originally published on July 6, 2015. It is being re-run as Steve is out of the office.

I ran across this comparison of SQL Server to PostgreSQL. It's written from the point of view of a PostgreSQL developer, who certainly doesn't like the Microsoft product much, with no shortage of complaints. Whether you agree or not, I do think there are a few valid points.

However one of the quotes that really caught my attention was in the section on converting dates. The author says that "MSDN provides a table of these magic numbers.", referring to the arcane and completely unintuitive format codes that we use with CONVERT(). Fortunately FORMAT() was introduced in 2012, and simplifies things, but still has issues and limitations.

Certainly all systems and languages will have some codes and parameters that don't make sense, left over from earlier times for backwards compatibility. However the more I look at T-SQL and SQL Server, the more I do find it silly that many of the small conveniences haven't evolved across the versions. The bcp utility is outdated, functions haven't been updated to work with more than 8,000 characters, SSIS has issues with CSV files, and more.

It does seem at times that when I'm answering questions on the Internet that the answers I give, while logical and familiar to me, seem magic to others. This might be especially true when talking about transaction logs, which still seem far to difficult for many people to grasp.

I enjoy working with SQL Server and look forward to a long career in the future developing software on the platform, however I do worry about some of the long term health of the platform for new users. It seems that the usability advantages of SQL Server have dramatically narrowed in recent years, and in some ways the other platforms have implemented features that SQL Server is sorely lacking.

Hopefully Microsoft will focus on reducing the friction of manipulating data in SQL Server. Not that SQL Server will go away, but I can see companies migrating to other platforms if it becomes substantially easier and cheaper to manipulate data.

Steve Jones from SQLServerCentral.com

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

ADVERTISEMENT
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 Change Automation

CI/CD  for your SQL Server database

Feeling the pain of managing and deploying database changes manually? Redgate SQL Change Automation completes your database delivery process by building, testing, and deploying the database changes you and your team check into version control.  
Try it free

Featured Contents

 

Create AT&T Network Hierarchy Diagrams using SQL Server Data

Paul Brewer from SQLServerCentral.com

Diagrammatic support for large, complex hierarchical data structures in SQL Server. More »


 

What SOX means to the DBA

The worry that processes in place to ensure compliance can bottleneck the development process is a very real one. So how can you have the best of both worlds? In this article Rebecca Edwards discusses the implications and possible solutions. More »


 

Modern Data Warehouse Design Pattern – Part I

Additional Articles from Database Journal

The modern data warehouse design helps in building a hub for all types of data to initiate integrated and transformative solutions. To achieve these goals and to support modern designs, Microsoft has introduced a set of fully managed, cloud-based services that not only support modern data warehouse design patterns but also provide the advantages of inbuilt scalability, high availability, good performance, and flexibility. More »


 

From the SQLServerCentral Blogs - Power BI Custom Visuals Class (Module 115 – Circle KPI Gauge)

Devin Knight from SQLServerCentral Blogs

In this module you will learn how to use the Circle KPI Gauge. The Circle KPI Gauge displays a single... More »


 

From the SQLServerCentral Blogs - Deploying To a Power Bi Report Server with PowerShell

Rob Sewell from SQLServerCentral Blogs

Just a quick post to share some code that I used to solve a problem I had recently. I needed to... More »

Question of the Day

Today's Question (by Steve Jones):

When I add a column set to this table, what data type should I choose?

 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 ____ COLUMN_SET FOR ALL_SPARSE_COLUMNS ) 

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

Microsoft SQL Server 2017 on Linux

This comprehensive guide shows, step-by-step, how to set up, configure, and administer SQL Server 2017 on Linux for high performance and high availability. Written by a SQL Server expert and respected author, Microsoft SQL Server 2017 on Linux teaches valuable Linux skills to Windows-based SQL Server professionals. You will get clear coverage of both Linux and SQL Server and complete explanations of the latest features, tools, and techniques. Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

What happens when this code is run?

 DECLARE @d DATETIMEOFFSET , @c VARCHAR(20) ; SELECT @c = '20180903' ; SELECT @d = @c ; SELECT @d ; 

Answer: '2018-09-03 00:00:00.0000000 +00:00'

Explanation:

The implicit conversion works and sets the time zone to UTC time.

Ref: Implicit Conversions - click here


» Discuss this question and answer on the forums

Featured Script

GenerateFullSequenceRestoreScripts_Litespeed

Harkamal Singh from SQLServerCentral.com

Basically used for DR 

create this SP in Master Database

Call it from SQL Agent to create the squence on DR server.

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

SQL 2017 - Log Truncation - Hi all After removing a database from our AlwaysOn AvailabilityGroup and put it into simple mode, i've tried to shrink the...


SQL Server 2017 : SQL Server 2017 - Development

Need to write query with conditioms - update tab1.ut_prc with tab2.prcup of seqnum in which amtperact fall under. for example if you take act1003, amtperact 76 fall under...

Grouping Records by evaluating the next record... - We have GPS data that we receive from several devices that we have.  When we receive the data there is...

Insert with dynamic SQL and Cursor for variable table/columns according to update list - Hi! I have a bit of a problem for a while. I have updated tables in Database A. These tables gets...


SQL Server 2016 : SQL Server 2016 - Administration

Managing a large SQL estate ? - Hi, not 2016 specific but cant see where else to ask it and we have a lot of 2016, and...

SQL Server 2016 SP2 installation : Configuring TEMP DB Initial Size and Autogrowth - Hi, Currently our databases are in SQL Server 2008 R2 and we are upgrading to SQL Server 2016. I wanted to...


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

Fiscal Year Partition with Fact tables - Hi, I want to implement fact table to hold current and last 2 fiscal year data and thought to implement partition function...

Optimize server for transaction rollback - Hello, We have a lot of sql server unit tests which works like following: 1. Begin tran 2. Setup testdata 3. Run some tests 4....

Order of Clustered Index - Let's say, hypothetically, I have a table with three columns--LastName, FirstName, MiddleName and I wanted to create a clustered index...

PIVOT - I need help with SQL PIVOT Example SELECT Manufacturer, CarType FROM Vehicles Manufacture         Cartype Ford                      SportsCar GM                        Truck Ford    


SQL Server 2014 : Administration - SQL Server 2014

Load Data Mart without reduce Read-Performance - Hi, what is the best practice for decoupling a DataMart (SQL 2014) which is filled several times a day by the...

Loading from a txt file in SSIS - Hi Experts , i am trying to load from txt file to a table in a database.On flat file file when...


SQL Server 2012 : SQL 2012 - General

Get databasename for a particular user - Hi all, I have a username I need to script and replicate to UAT, but no indication of which DB...


SQL Server 2012 : SQL Server 2012 - T-SQL

Need help Insert and Update in Single Statement - I've tables as follow CREATE TABLE .(      IDENTITY(-2147483648,1) NOT NULL,      NULL,      (5) NULL,     [group_2Dig


SQL Server 2008 : SQL Server 2008 - General

ERROR IN SSIS - I have package i am running and i get the below once a week i am inserting data through lookup...


SQL Server 2008 : SQL Server Newbies

Index scan and Index seek - Good Morning Experts, Execution plan was using index seek till yesterday, but today it is using index scan. I am not...


SQL Server 2008 : SQL Server 2008 Administration

Should I create a Staging Instance or Staging Database on the same Production Server? (Can only do SAME PRODUCTION SERVER) - Hello All, I currently manage a data processing department for a Marketing firm and we deal with TB's of data. We manage...


Cloud Computing : SQL Azure - Administration

sql profiler in managed instances - We are evaluating SQL managed instance  I used tutorial bellow to build managed instance and build client machine to manage it https://docs.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-get-started "Since...

SQL Server 2016 SP1 (Azure IaaS) slower than SQL 2008 SP2 on premise - I have an issue with a stored proc that uses a cursor (yes, I KNOW THIS ISN'T GOOD) however it...


Data Warehousing : Integration Services

Load DataMart parallel - Hi, What is the best practice for decoupling a DataMart (SQL2014) which is filled several times a day by the DWH...

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