In this article, I’m going to explain the Dynamic Data Masking feature in SQL Server. As it goes by the name, Dynamic Data Masking is one of the security features that was introduced in SQL Server 2016. In an ever-growing digital era, the security of ones’ data has become one of the most important and expensive deals. Everyone expects their data to be protected as their own asset and like to treat it with the highest efficiency possible.
Read more »Database development
Introduction to Row-Level Security in SQL Server
March 31, 2020In this article, I’m going to discuss Row-Level Security in SQL Server. RLS or Row-Level Security as the name suggests is a security mechanism that restricts the records from a SQL Server table based on the authorization context of the current user that is logged in. This means the records from the tables are displayed based on who the user is and to which records do the user has access to. This is usually done to allow specific users to have access to their data only without permission to view other users’ data.
Read more »Working with SQL Server ROWCOUNT
March 30, 2020In this article, we will discuss the SQL Server @@ROWCOUNT and ROWCOUNT system objects by going through practical examples that cover most of these system objects usage.
Read more »Learn to write basic SQL Queries
March 27, 2020Essentially, SQL language allows us to retrieve and manipulate data on the data tables. In this article, we will understand and gain the ability to write fundamental SQL queries. At first, we will take a glance at the main notions that we need to know about in order to write database queries.
Read more »Solve Time Zone, GMT, and UTC problems using the T-SQL Toolbox database
March 23, 2020Introduction
Soon enough, the applications and database software we build will handle date and time values. The T-SQL Toolbox database – a free download – can help solve complex calculations with those values.
Read more »How to drop temp tables in SQL Server
March 23, 2020Temporary tables, also known as temp tables, are widely used by the database administrators and developers. However, it may be necessary to drop the temp table before creating it. It is a common practice to check whether the temporary table exists or not exists. So, we can eliminate the “There is already an object named ‘#temptablename’ in the database” error during the temporary table creation.
Read more »An overview of the sp_WhoIsActive stored procedure
March 23, 2020This article gives a comprehensive overview of custom stored procedure sp_whoisactive.
Read more »Learn SQL: User-Defined Stored Procedures
March 5, 2020Stored procedures (SPs) are one more powerful database object we have at our disposal. They can help us handle many tasks and improve performance and security. Today, we’ll take a look at simple SPs and show, on examples, how to use them.
Read more »SQL Server Auto Shrink database property
March 5, 2020In this article, we will discuss the SQL Server Auto Shrink database property, which allows SQL Server to automatically shrink the database files when the value is configured as True in the database option. Automatic shrink operation is done by the server auto shrink database feature, which is the main course of this article.
Read more »OLAP Cubes in SQL Server
February 6, 2020An Online Analytical Process (OLAP) cubes are used as an analytical tool. An OLAP Cube is a multi-dimensional database that is optimized for reporting purposes.
Read more »How to send database mail using a CLR stored procedure
February 3, 2020In this article, I am going to explain how we can send an email from SQL Server express edition using a CLR stored procedure. First, let me explain about the CLR stored procedures.
Read more »An overview of the CONCAT function in SQL with examples
January 13, 2020In this article, we will explore the syntax, working mechanism and other details of the CONCAT function in SQL and we will also make up various different examples about it.
Read more »An overview of sp_getapplock and sp_releaseapplock stored procedures
January 9, 2020This article explains about the sp_getapplock and sp_releaselock stored procedures and their usage with example.
Read more »Introduction to the sp_executesql stored procedure with examples
January 9, 2020The sp_executesql is a built-in stored procedure in SQL Server that enables to execute of the dynamically constructed SQL statements or batches. Executing the dynamically constructed SQL batches is a technique used to overcome different issues in SQL programming sometimes. For example, when we want to determine the displayed columns in our reports, this procedure might be a solution option for us. In the simplest sense, this procedure takes a dynamically constructed SQL batch and other parameters, then execute it in the runtime and, finally, it returns the result.
Read more »Install and configure the AdventureWorks2016 sample database
January 9, 2020This article explains the process of installing the AdventureWorks2016 and AdventureWorksDW2016 sample database on a stand-alone instance of SQL Server and Azure SQL Server. The sample databases were published by Microsoft to demonstrate how to design a database using SQL Server. Microsoft has also published another lightweight database named AdventureworksLT, which can be used as a sample database on Azure SQL Server.
Read more »SQL Unit Testing Data Warehouse Extracts with tSQLt
January 7, 2020This article talks about basic concepts of SQL unit testing from a Data Warehouse point of view using tSQLt, a highly productive and acclaimed SQL unit testing framework.
Read more »An overview of the STRING_AGG function in SQL
January 3, 2020In this article, we will explore the STRING_AGG function in SQL and we will also reinforce our learning with various examples. STRING_AGG function can be counted as a new member of the SQL aggregation functions and it was announced in SQL Server 2017. STRING_AGG function gathers all expression from rows and then puts it together in these rows expression in order to obtain a string. Additionally, this function takes a separator parameter that allows separating the expressions to be concatenated.
Read more »Rollback SQL: Rolling back transactions via the ROLLBACK SQL query
December 26, 2019The rollback SQL statement is used to manually rollback transactions in MS SQL Server.
Read more »SQL Injection: Introduction and prevention methods in SQL Server
December 25, 2019A SQL injection attack is one of the most commonly used hacking techniques. It allows hacks to access information from a database that is otherwise not publically accessible.
Read more »Using sp_executesql stored procedure for executing dynamic SQL queries
December 24, 2019The sp_executesql stored procedure is used to execute dynamic SQL queries in SQL Server. A dynamic SQL query is a query in string format. There are several scenarios where you have an SQL query in the form of a string.
Read more »Understanding the SQL EXCEPT statement with examples
December 23, 2019The SQL EXCEPT statement is one of the most commonly used statements to filter records when two SELECT statements are being used to select records.
The SQL EXCEPT statement returns those records from the left SELECT query, that are not present in the results returned by the SELECT query on the right side of the EXCEPT statement.
Read more »Send an alert when the database state changes to SQL Server single-user mode
December 18, 2019This article explains the SQL Server single-user mode and how to configure an automated email alert when the state of the user database changes to the single-user mode. To send an alert, we will create a DDL trigger that executes when the user runs the ALTER DATABASE query. It collects the pieces of information using EVENTDATA() function, saves it in a temporary table, and sends an HTML formatted email.
Read more »How to create a view in SQL Server
December 16, 2019In this article, we will learn the basics of the view concept in SQL Server and then explore methods to create a view in SQL using T-SQL and SQL Server Management Studio.
Read more »An overview of SQL Server data types
December 9, 2019In this article, we will give an overview of various SQL Server data types.
Read more »An overview of the SQL Server Update Join
December 5, 2019This article explores the SQL Server Update Join statement in T-SQL for SQL Server.
Read more »