Remove c
article thumbnail

T-SQL bugs, pitfalls, and best practices – pivoting and unpivoting

SQL Performance

As an example with our task, suppose that you don't realize that the grouping element is determined implicitly, and you come up with the following query: SELECT shipperid , [ 2017 ] , [ 2018 ] , [ 2019 ] FROM Sales. So you're expecting to see only three rows in the result. 830 rows affected).

article thumbnail

Overlooked T-SQL Gems

SQL Performance

The EOMONTH function was introduced in SQL Server 2012. Many people are not aware that SQL Server 2017 introduced a new function called TRANSLATE that simplifies such replacements a great deal. SQL Server 2017 introduced support for the function TRIM. SQL Server 2012 introduced the function CONCAT.

C++ 111
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Take the SQL Server Mac challenge

SQL Server According to Bob

I also started my career developing on UNIX systems with C++ and databases like Ingres. When I joined Microsoft in 1993, I would embark on a 25 year journey working only on Windows laptops and Windows Server computers. Last October we released SQL Server 2017 including support for Linux and Docker Containers.

Servers 40
article thumbnail

NULL complexities – Part 3, Missing standard features and T-SQL alternatives

SQL Performance

Curiously, SQL Server's query processor already supports an internal comparison operator IS, which uses the same semantics as the desired IS operator I described here. Here's the complete solution code: WITH C AS. ( 10249 2017-07-10 10252 2017-07-11 10250 2017-07-12. Figure 1: Plan for Query 1.

C++ 120
article thumbnail

MariaDB vs MySQL: Key Differences and Use Cases

Percona

This blog post was originally published in November 2017 and was updated in June 2023. In this blog, we’ll provide a comparison between MariaDB vs. MySQL (including Percona Server for MySQL ). MariaDB Server, on the other hand, is a fork of MySQL 5.5.

article thumbnail

SQL Mysteries: SQL Server Login Timeouts – A Debugging Story

SQL Server According to Bob

. · Failures occur from remote clients or sqlcmd executed directory on the server (/opt/mssql-tools/bin). SQL Server 2017 CU10 does not show behavior. · SQL Server 2017 CU12 exhibits the behavior. Server is a Superdome with lots of CPUs and RAM. Here is an example of a valid SQL Server login.

Servers 40
article thumbnail

NULL complexities – Part 1

SQL Performance

WHERE NOT ( shippeddate = '20190102' ) ; This query returns the following output: orderid shippeddate -- -- 10249 2017-07-10 10252 2017-07-11 10250 2017-07-12. WHERE shippeddate IS NOT NULL ; This query generates the following output: orderid shippeddate -- -- 10249 2017-07-10 10252 2017-07-11 10250 2017-07-12.