This article explores the useful function SQL IF statement in SQL Server.
SQL commands
SQL Server CONCATENATE Operations with SQL Plus (+) and SQL CONCAT functions
May 13, 2019This article explores SQL Server Concatenate operations using the SQL Plus (+) operator and SQL CONCAT function.
Read more »SQL Server Always ON Availability Group Log Backup on Secondary Replicas
May 10, 2019In a high OLTP environment, we may observe strain on CPU and IO due to frequent backups. It might include further complexity due to backup compressions. SQL Server Always On Availability groups provides the capability to perform database backups from the secondary replicas. This article explores Log backups in SQL Server Always On Availability Group.
SQL ISNULL function
May 10, 2019This article explores the SQL ISNULL function to replace NULL values in expressions or table records with examples.
SQL CHARINDEX
May 9, 2019We 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 »DATEADD SQL function introduction and overview
May 6, 2019This article explores the DATEADD SQL function and its usage scenarios with various examples.
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 »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 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 »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 »SQL string functions for Data Munging (Wrangling)
September 13, 2018In this article, you’ll learn the tips for getting started using SQL string functions for data munging with SQL Server. In many cases, Machine learning outcomes are only as good as the data they’re built on – but the work of preparing data for analytics (that is, data wrangling) can eat up as much as 80% of your project efforts.
Read more »Introduction to mssql-cli, a new interactive command line tool for SQL Server
January 31, 2018Microsoft recently released a new and interactive command-line query tool for SQL Server with modern features such as auto-completion and syntax highlighting. It’s called mssql-cli and this fully open source tool works on cross-platform under the BSD-3 license.
Read more »An introduction to the bcp Utility (bulk copy program) in SQL Server
November 9, 2017Introduction
The Bulk copy program aka bcp is the console application used to export and import data from text files to SQL Server or vice versa.
It is very popular because it is fast and easy to download.
Read more »Working with the SQL Server command line (sqlcmd)
October 18, 2017Introduction
Sqlcmd allows executing queries, T-SQL sentences and SQL Server scripts using the command line.
In the previous article How to work with the command line and Azure to automate tasks, we worked with the sqlcmd in Azure.
In this new chapter, we will show the following examples in a local SQL Server using sqlcmd:
Read more »An introduction to sp_MSforeachtable; run commands iteratively through all tables in a database
August 18, 2017Introduction
There have always been some undocumented objects in SQL Server that are used internally by Microsoft, but they can be used by anybody that have access to it. One of those objects is a stored procedure called sp_MSforeachtable.
sp_MSforeachtable is a stored procedure that is mostly used to apply a T-SQL command to every table, iteratively, that exists in the current database.
Read more »SQL Server Database Recovery Process Internals – database STARTUP Command
February 14, 2017A database recovery process is an essential requirement for database systems, It can be a tedious job and the process of recovery varies on lot of scenarios. The desire to improve recovery results has resulted in various procedures, but understood by few and prone to errors. In this article, I’ll illustrate the impact of stopping the database instance in the middle of a large transaction that was running and discuss several techniques and tools that are available for faster and successful recovery.
Read more »Connecting PowerShell to SQL Server – Using a Different Account
January 24, 2017Introduction
In a previous article on Connecting PowerShell to SQL Server I went over how you use various methods in PowerShell to connect to SQL Server. In those examples though I only touched on using the current user that is running “PowerShell.exe”. In this article I want to pick up and go over how you would use the same methods, but as a different account. I will cover using both Windows Authentication (where supported) and SQL Login authentication.
Read more »How to use SQLCMD commands in the SSMS query editor
December 13, 2016SQLCMD Mode allows creating, testing, executing SQLCMD commands or scripts in SQL Server Management Studio directly in the query editor. This option is available since SQL Server 2005.
Read more »