This article explores the DATEPART SQL function and its use in writing t-SQL queries. In the previous article, SQL Convert Date Functions and Formats, we explored various data formats and convert them using SQL Convert function.
Functions
SQL Add Column operations
April 22, 2019This article explains the SQL add column operation into an existing SQL table. We will also explore different examples of SQL add column operations.
Read more »SQL Union vs Union All in SQL Server
April 18, 2019This article explains to the SQL Union and vs Union All operators in SQL Server. We will also explore the difference between these two operators along with various use cases.
Read more »SQL OUTER JOIN overview and examples
April 16, 2019This article will provide a full overview, with examples of the SQL Outer join, including the full, right and left outer join as well as cover the union between SQL left and right outer joins.
Read more »INSERT INTO SELECT statement overview and examples
April 12, 2019This article covers the SQL INSERT INTO SELECT statement along with its syntax, examples, and use cases.
Read more »SQL PARTITION BY Clause overview
April 9, 2019This article will cover the SQL PARTITION BY clause and, in particular, the difference with GROUP BY in a select statement. We will also explore various use cases of SQL PARTITION BY.
Read more »SQL Order by Clause overview and examples
April 9, 2019This article will cover the SQL ORDER BY clause including syntax, usage scenarios to sort out results in a Select statement.
Read more »SQL SELECT INTO statement
April 5, 2019This article will cover the SQL SELECT INTO statement including syntax, parameters and use with multiple tables, filegroups and a WHERE condition
Read more »SQL Foreign key
April 5, 2019In this article let us review different ways to create a SQL foreign key, rules on updates and deletes, enabling foreign key constraints, disabling foreign key constraints and not for replication in foreign keys.
Read more »SQL Convert Date functions and formats
April 3, 2019In this article, we will explore various SQL Convert Date formats to use in writing SQL queries.
Read more »CASE statement in SQL
April 1, 2019The case statement in SQL returns a value on a specified condition. We can use a Case statement in select queries along with Where, Order By, and Group By clause. It can be used in the Insert statement as well. In this article, we would explore the CASE statement and its various use cases.
Read more »SQL Convert Function
January 29, 2019In this article, we will discuss and learn basics and all details about SQL Server data type converting operations and also we will review the SQL CONVERT and TRY_CONVERT built-in functions with various samples. At first, we will explain and clarify syntax of the SQL CONVERT function and then we will learn how can we make data converting process numerical and date/time data types to character data.
Read more »Columnstore Index Enhancements – online and offline (re)builds
December 13, 2018In this article, we will explore ‘ Clustered columnstore online index build and rebuild’ feature of SQL Server 2019 including comparing execution plans, offline builds and more
Read more »The STRING_SPLIT function in SQL Server
December 3, 2018This article will cover the STRING_SPLIT function in SQL Server including an overview and detailed usage examples.
An MDS Driven Approach to a Turnaround Time Calculation in SQL Server
November 30, 2018One calculation that you are almost guaranteed to have to produce in your career as a T-SQL developer relates to the calculation of a turnaround time. This is often a key KPI for measuring the performance of both individuals and teams, particularly when the business operates within a service-oriented sector i.e. customer support, transportation, healthcare etc. Turnaround time calculation does not only refer to business metrics rather any activity (i.e. ordering a pizza) with a recorded start and an end time can have its own turnaround time calculated. In this article we evaluate different options for calculating a turnaround time including using DATEDIFF function, creating your own user-defined function (UDF) as well as an integration with SQL Server Master Data Services.
Read more »Overview of the SQL REPLACE function
November 27, 2018In this article, I’ll show you how to find and replace data within strings. I will demonstrate how to use the function SQL REPLACE, where you look for a substring within a string, and then replace it.
Overview of SQL COUNT and COUNT_BIG in SQL Server
November 23, 2018In this article, we’ll walk-though two other important SQL aggregate function, SQL COUNT and COUNT_BIG. In the previous article of this series, we covered how to retrieve data, join tables, work with dates and times, use window functions, filter data, and much more.
Read more »Overview of the SQL Order by clause
November 23, 2018In this article, we’ll walk-through the concept of the SQL Order by clause and understand how the SQL engine works with the ordering result in a query.
Read more »SQL CAST and SQL CONVERT function overview
November 16, 2018This article is an effort to discuss SQL Cast and SQL Convert functions as a follow-up to previous articles, in which we’ve discussed several SQL tips such as SQL Date, SQL Coalesce, SQL Union, SQL Join, SQL Like, SQL String etc.
Read more »Columnstore Index Enhancements – data compression, estimates and savings
November 14, 2018Data compression is required to reduce database storage size as well as improving performance for the existing data. SQL Server 2008 introduced Data compression as an enterprise version feature. Further to this, SQL Server 2016 SP1 and above supports data compression using the standard edition as well.
Read more »Overview of the SQL ROW_NUMBER function
November 13, 2018In this article, we’re going to discuss the SQL ROW_NUMBER function. This is a continuation of the SQL essential series. In this guide, I’ll explain what a window function is all about, and you’ll see sample examples to understand the concepts behind the SQL ROW_NUMBER function.
Read more »The new SQL Server 2019 function Approx_Count_Distinct
November 9, 2018SQL Server 2019 has a rich set of enhancements and new features. In particular, there are many new feature improvements in the database engine for better performance and query tuning.
Read more »Columnstore Index Enhancements – Index stats update in clone databases
November 9, 2018SQL Server was launched in 1993 on WinNT and it completed its 25-year anniversary recently. SQL Server has come a long way since its first release. At the same time, Microsoft announced a preview version of SQL Server 2019. SQL Server 2019 provides the ability to extend its support to big data, Apache Spark, Hadoop distributed file system (HDFS) and provides enhancements to database performance, security, new features, and enhancements to SQL Server on Linux.
Read more »Enhanced PolyBase SQL 2019 – External tables SQL Server, Catalog view and PushDown
November 6, 2018This article is part 4 of the series for SQL Server 2019 Enhanced PolyBase. Let quickly recap the previous articles.
Read more »SQL date format Overview; DateDiff SQL function, DateAdd SQL function and more
October 31, 2018SQL date format functions like the DateDiff SQL function and DateAdd SQL Function are oft used by DBAs but many of us never took the time to fully understand these extremely useful features. For professionals just getting started with SQL Server, these functions are some of the first to become familiar with. So hopefully this article will have a little something for everyone across the skill spectrum
Read more »