We use the SQL CHARINDEX function to find the position of a substring or expression in a given string. We might have a character in different positions of a string. SQL CHARINDEX returns the first position and ignores the rest of matching character positions in a string.
Read more »Data Sampling with Python SQL Scripts
May 9, 2019Introduction
The Python programming language is object oriented, easy to use and, widely used programming language. We can write simple Python SQL Scripts and it performs the task that is not easy to do with t-SQL.
SQL Unit Testing Mocking Stored Procedures
May 8, 2019In this SQL Unit testing article, we will continue our journey with SQL unit testing. In the previous articles of this series (see the TOC at the bottom), we mentioned about SQL unit testing essentials and designing approaches as well and then we reinforce these notions with various tSQLt framework practical examples. In this article, we will continue to learn how to mock stored procedures in the tSQLt framework and we will provide it with two examples.
Read more »SQL Server cursor attributes
May 8, 2019A SQL Server cursor is a database object that is used to process the data in a set row by row. In this article, we will review how to create a cursor and different attributes used while declaring a cursor.
Read more »10 Most Common SQL Unit Testing Mistakes
May 7, 2019This SQL unit testing article is based on the fact that we often learn from the mistakes so the idea is to highlight the mistakes to understand them clearly so that they can be avoided straight away.
Read more »DATEADD SQL function introduction and overview
May 6, 2019This article explores the DATEADD SQL function and its usage scenarios with various examples.
Data synchronization in SQL Server Always On Availability Groups
May 3, 2019This article describes the data synchronization process on SQL Server Always On Availability Groups in both Synchronous, and Asynchronous data commit mode.
Read more »SQL Server monitoring tool for CPU performance
May 3, 2019CPU pressure slowing down the server
This article is the sequel in a series about SQL Server monitoring tools and common performance issues. Before reading this piece, it advisable to read the previous two articles about monitoring tools for disk I/O and memory performance:
Read more »How to use fake functions with SQL unit testing?
April 30, 2019In this article series, we are exploring SQL unit testing, in general, and also we are reinforcing details and topics with various practical examples. We are using the tSQLt framework because it is the quite powerful and handy tool in order to develop and code SQL unit tests.
Read more »Fix Orphan users in SQL Server using DBATools PowerShell
April 30, 2019This article gives an overview of Orphan users and fixing them using DBATools PowerShell.
Read more »Azure Costs Tracking with Security and Design Considerations
April 30, 2019Azure costs can quickly mount, without careful supervision and management. This article will detail cost mitigation strategies using security and design
Read more »AWS RDS SQL Server Migration using AWS Database migration service
April 30, 2019In this article, we will review how to migrate database from on-premise SQL Server instance to AWS RDS SQL Server instance using AWS Database migration service. There are different ways to migrate the database to the AWS RDS instance:
Read more »SQL TRIM function
April 24, 2019In this article, we will review the new SQL TRIM function in SQL Server 2017 onwards as well as providing some information on strings functions that pre-date it like LTRIM AND RTRIM.
Read more »DATEPART SQL function
April 23, 2019This 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.
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 »Using the SQL Server Audit Feature to Audit Different Actions
April 22, 2019In the previous article of the SQL Server Audit series, SQL Server Audit Feature Components, we discussed the three main components of the SQL Server Audit feature; the SQL Server Audit, the Server Audit Specifications, and the Database Audit Specifications in details. In this article, we will show how to use the SQL Server Audit feature to track, log and review the different operations performed at both the SQL Server and the database levels.
Read more »SQL Server Transaction Log Administration Best Practices
April 22, 2019In this article, we will go through a number of SQL Server Transaction Log recommendations and best practices that each database administrator needs to follow in order to enjoy his holidays and have a pleasant sleep without nightmares or calls during the night.
Read more »How to use fake tables in SQL unit testing?
April 22, 2019In this article on SQL unit testing, we will talk about how to isolate SQL unit tests from dependencies and how to use fake tables in SQL unit tests, so that we will able to develop more robust and less fragile SQL unit tests.
Read more »Fundamentals of Test-Driven Database Development (TDDD) with tSQLt unit testing
April 19, 2019This article talks about core concepts of test-driven database development followed by creating simple SQL unit tests with tSQLt based on this approach.
Read more »PowerShell encrypt password techniques for SQL Server
April 18, 2019Challenge
Automating SQL Server tasks with PowerShell can increase productivity and save time, but how do use PowerShell encrypt password techniques to avoid saving them as plain text. This article will show you how.
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 »SQL Server Transaction Log Backup, Truncate and Shrink Operations
April 16, 2019In this article, we will cover SQL Server Transaction log backups, truncate and shrink operations with an overview and examples covering everything discussed
SQL Code Snippets in Azure Data Studio
April 16, 2019This article will fully cover the code snippet SQL developer productivity feature in Azure Data Studio including a list of available snippets and examples of how to create custom code snippets
Read more »SQL Server Audit Feature Components
April 15, 2019In the previous articles of the SQL Server Audit series (see the TOC at the bottom), we discussed the concept of the SQL Server Audit, why we need an audit solution to track and log the different events performed in our SQL Server instances and databases, and went through the different methods that can be used to audit the SQL Server databases. In this article, we will discuss the SQL Server Audit feature components and how to configure it.
Read more »