Setting alternate row colors in SSRS (SQL Server Reporting Services) is an important visualization configuration for end-users so that they can easily view their reports. However, setting alternate colors in SSRS is not a click of a button configuration like in the Microsoft Excel.
Read more »Development
T-SQL RegEx commands in SQL Server
September 17, 2019This article explores T-SQL RegEx commands in SQL Server for performing data search using various conditions.
Read more »SQL Server multi-statement table-valued functions
September 11, 2019In this article, we will learn multi-statement table-valued functions (MSTVFs) basics and then we will reinforce our learnings with case scenarios.
Read more »Overview of SQL LOWER and SQL UPPER functions
September 10, 2019This article gives an overview of SQL UPPER function and SQL LOWER function to convert the character case as uppercase and lowercase respectively.
Read more »Overview of the SQL DELETE Column from an existing table operation
September 6, 2019In this article, we will explore the process of SQL Delete column from an existing table. We will also understand the impact of removing a column with defined constraints and objects on it.
Read more »SSIS Conditional Split overview
September 4, 2019SQL Server Integration Services or SSIS is used as an ETL tool to extract-transform-load data from heterogeneous data sources to different databases. After extracting data from the different sources, most often there are a lot of transformations needed. One of the frequent transformations is SSIS Conditional Split.
Read more »Different ways to SQL delete duplicate rows from a SQL Table
August 30, 2019This article explains the process of performing SQL delete activity for duplicate rows from a SQL table.
Read more »SQL Injection: Detection and prevention
August 30, 2019Summary
With an understanding of what SQL injection is and why it is important to an organization, we can shift into a discussion of how to prevent it. We ultimately want systems where SQL injection is impossible or very difficult to pull off. We then want systems where exploiting bugs is slow, laborious, and likely to raise monitoring alarms within an organization when attempted. The trio of layered security, prevention, and alerting can provide an immense advantage against not only SQL injection, but other data security threats.
Read more »SQL Injection: What is it? Causes and exploits
August 30, 2019Summary
Many security vulnerabilities are discovered, patched, and go away forever. Some linger and continue to plague software development and will continue to do so for years to come. Setting aside social engineering and non-technical attacks, SQL injection remains one of the top security threats to our data, as well as one of the most misunderstood.
Read more »SQL Server inline table-valued functions
August 29, 2019In this article series, we will find basics and common usage scenarios about the inline table-valued functions and we will also be consolidating your learnings with practical examples.
Read more »SQL Server ALTER TABLE ADD Column overview
August 27, 2019In this article, we will explore SQL Server ALTER TABLE ADD Column statements to add column(s) to an existing table. We will also understand the impact of adding a column with a default value and adding and updating the column with a value later on larger tables.
Read more »Dynamic SQL in SQL Server
August 15, 2019In this article, we will review how to construct and execute dynamic SQL statements in SQL Server with different examples.
Read more »Clustered Index vs. Heap in SQL Server
June 21, 2019Summary
There are few topics so widely misunderstood and that generates such frequent bad advice as that of the decision of how to index a table. Specifically, the decision to use a heap over a clustered index is one where misinformation spreads quite frequently.
Read more »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 »Methods to Insert Data into SQL Server
April 10, 2019Summary
There are a variety of ways of managing data to insert into SQL Server. How we generate and insert data into tables can have a profound impact on performance and maintainability! This topic is often overlooked as a beginner’s consideration, but mistakes in how we grow objects can create massive headaches for future developers and administrators.
Read more »Nested Triggers in SQL Server
March 27, 2019Nested Triggers in SQL Server are actions that automatically execute when a certain database operation is performed, for example, INSERT, DROP, UPDATE etc.
Read more »Securely Working with Invoke-SqlCmd
March 26, 2019We have a convenient tool for working with PowerShell and SQL Server when using Invoke-SqlCmd. As we saw when running statements, we can run DDL and DML changes with the command without writing our own custom scripts. This carries advantages when we need to quickly develop with PowerShell, but it can come with drawbacks on security if we’re not careful how we use this function. We’ll look at security when using this function by starting with a few examples of what we can do when we have unlimited access along with how we can design to limit our environment to be strict with our use of this tool.
Read more »Working with PowerShell’s Invoke-SqlCmd
March 18, 2019PowerShell features many one-line commands for working with SQL Server, one of which is Invoke-SqlCmd. This tool can be useful in many development contexts where we need to quickly execute scripts or test code and it helps to know some of the parameters we’ll often use. In addition, because we may want a custom script using some of the underlying .NET objects, we’ll look at an alternative where we will be able to create a custom PowerShell script that connects to SQL Server in order to run commands. The latter can be useful because one-line scripts have a tendency to change in future versions of PowerShell and working with the library directly can sometimes avoid this challenge.
Read more »SQL Unit Testing with SSDT (SQL Server Data Tools)
February 12, 2019In this article, we will discuss the essentials of the SQL unit testing and then we will explore how to apply SQL unit testing methodology in Azure SQL Database with help of SQL Server Data Tools (SSDT). In particular, this article will focus about unit test theory in terms of SQL Server database development aspect and illustrate SQL unit testing with a detailed example.
Read more »FILESTREAM in SQL Server
January 11, 2019This article will discuss SQL Server FILESTREAM including installation, configuration, enabling and general considerations.
Working With Line Numbers and Errors Using Bulk Insert
January 10, 2019In the first part of reviewing the basics of bulk insert, we looked at importing entire files, specifying delimiters for rows and columns, and bypassing error messages. Sometimes we’ll want to skip first and ending lines, log errors and bad records for review after inserting data, and work with data types directly without first importing using a varchar and converting to the data type later. In this part, we look at these techniques using T-SQL’s native bulk insert.
SQL Server Code simplification using synonyms
January 4, 2019Problem
In our environment, we use different DB servers and these servers are linked via Linked servers for cross server transactions. We use these linked servers in our stored procedures. The server names are different in different environments and we had to change the server names manually when we promote the stored procedures to other environments. There is a chance of errors while changing the server names manually. In this article let us see how can we eliminate changing the code manually.
Read more »Ask a Question feature in Power BI Desktop
December 21, 2018In this article, we are going to learn how to use Power BI Desktop Q&A functionality to enable users to ask the question from the data set and easily get the results without any configuration or write complex codes.
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 »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 »