T-SQL

Prashanth Jayaram

Stairway to SQL essentials

April 7, 2021 by

SQL Essentials stairway series helps readers understand the most common database language SQL uses for data munging and data wrangling. SQL Essentials articles is a collection of SQL standards and best practices and help you take you in step closer to learn database query.

Read more »
Emil Drkusic
the data model

Learn SQL: Dynamic SQL

March 3, 2021 by

Dynamic SQL is a programming technique you can use to build SQL statements as textual strings and execute them later. This technique could prove to be useful in some cases and therefore it’s good to know we have it as an option. In today’s article, we’ll show how to create and execute dynamic SQL statements.

Read more »
Esat Erkec
Making practice is always important to learn SQL

Getting started with SQL Programming

February 3, 2021 by

Learning SQL programming is valuable for our career and might help to increase our incomes but most importantly it will be the best investment you will make for yourself. However, beginners don’t know the exact starting point to begin learning the SQL language. Learning SQL depends entirely on your effort and desire, and other things are just details. This article will give some tips on how to learn SQL without going into technical details so that so you can get started in learning SQL right now.

Read more »
Nisarg Upadhyay
Screenshot of email

T-SQL scripts to update statistics based on the row modification

December 24, 2020 by

In this article, we are going to learn how we can develop a T-SQL script to update statistics of tables based on the row modification. It is always a challenging task to perform maintenance on a table that has billions of rows. During the early years of my professional career, I was assigned a project and one of our clients had performance issues. The initial analysis showed that due to frequent data modifications, a specific table’s statistics become outdated.

Read more »
Emil Drkusic
the data model

Learn SQL: SQL Injection

November 2, 2020 by

SQL Injection is a well-known technique used to attack SQL-based applications. In this article, we’ll focus on examples showing how you could exploit database vulnerabilities using this technique, while in the next article we’ll talk about ways how you can protect your application from such attacks.

Read more »
Nisarg Upadhyay
Job schedule

T-SQL scripts to generate database health reports

October 21, 2020 by

In this article, I am going to show how we can automate a database daily health report using T-SQL scripts. For a senior database administrator, it is always important to review the health of the database server. When a DBA manages many database servers, it becomes difficult to visit every server and review the status of databases, SQL jobs, and backups. To ease the monitoring, I have developed a T-SQL script that populates the following information:

Read more »
Emil Drkusic
joining two tables using > operator

Learn SQL: Non-Equi Joins in SQL Server

September 29, 2020 by

Non-Equi join in SQL Server sounds like something abstract (and fancy), but it’s not so abstract (and fancy) at all. The same stands for equi joins. After reading this article, I hope you’ll agree on that with me. Today’ I’ll try to explain what they are and when you should use them. So, let’s start.

Read more »
Emil Drkusic
SQL-related jobs - the data model

Learn SQL: SQL-Related Jobs

September 1, 2020 by

In today’s article, we’ll take a look at 4 common SQL-related jobs and roles and explain what kind of tasks you could expect at each of these roles and what types of queries you’ll possibly use to solve these tasks. If you’re already in any of these roles, you’re probably familiar with this, but if you’re new to the world of SQL, you could find this very useful to decide in which way you want your career to develop.

Read more »
Rajendra Gupta
Copy file using the xp_cmdhell

T-SQL scripts to copy or remove files from a directory in SQL Server 2019

August 21, 2020 by

Sometimes database professionals need to perform specific tasks at the operating system level. These tasks can be like copying, moving, deleting files and folders. A use case of these tasks might be removing the old backup files or copying backup files to a specific directory after a particular time. In SQL Server, we can use xp_cmdshell extended stored procedure to execute commands directly in the Windows command prompt(CMD). You need a sysadmin role or proxy account configured to use this extended procedure. We can also use the SSIS package for the file transfer, but it also requires you to build a package with the relevant tasks.

Read more »
Aveek Das
Binary Search Tree Example

Diving deep with complex Data Structures

July 29, 2020 by

In my previous article, Understanding common Data Structures, I have mentioned the most commonly used data structures in software programming. In this article, let us get into some more details about the other data structures that are a bit complex than the ones already discussed but also used quite often while designing software applications. Here, we will look into the following data structures.

Read more »
Emil Drkusic
Naming convention - the data model

Learn SQL: Naming Conventions

July 28, 2020 by

A naming convention is a set of unwritten rules you should use if you want to increase the readability of the whole data model. Today, I’ll try to explain how you should formulate your naming convention and, maybe even more important, why should you do it and what is the overall benefit from using it.

Read more »
Aveek Das

Understanding the SQL MERGE statement

July 27, 2020 by

In this article, I am going to give a detailed explanation of how to use the SQL MERGE statement in SQL Server. The MERGE statement in SQL is a very popular clause that can handle inserts, updates, and deletes all in a single transaction without having to write separate logic for each of these. You can specify conditions on which you expect the MERGE statement to insert, update, or delete, etc.

Read more »
Aveek Das

Understanding common Data Structures

July 15, 2020 by

In this article, I am going to walk you through the concepts of the common Data Structures that every student, colleague working with computers should be aware of. Data Structure forms an integral part of any system or database design. It is a very interesting and intuitive concept that you can apply anywhere. Through this article, I aim to introduce the beginners to the concepts of Data Structures and brush up the same for colleagues who have already been associated with the industry for years. This will also help you understand some database concepts more easily once you have a grasp over these concepts.

Read more »
Bojan Petrovic
Results grid showing before and after values of the Vacation Hours column

SQL UPDATE syntax explained

July 10, 2020 by

This article will get you familiar with the SQL UPDATE syntax and demonstrate how this statement can be used for modifying data using T-SQL. Data modification side of DML language in T-SQL includes three statements used for modifying data in SQL Server and those are: INSERT, UPDATE, and DELETE. The focus here will be on the UPDATE statement explicitly.

Read more »
Jignesh Raiyani
Calling SQL Server Procedure inside the Function

Execute a SQL Server procedure inside a function

June 23, 2020 by

In this article, we will ensure that the execution of the SQL Server procedure inside the function is possible. A common understanding of the database developer is that the procedure cannot be utilized or executed inside a user-defined function because the user-defined function does not allow performing DML operation with the table. The procedure is allowed to play with the database and its property, whether a user-defined function isn’t. That should be the essential reason behind allowing the execution of a SQL Server procedure inside the function.

Read more »