DATALENGTH Function in SQL Server

DATALENGTH Function in SQL Server Returning String Length in Bytes

In this SQL Server tutorial, I will teach you about the DATALENGTH function in SQL Server with different examples. While working the database, such as retrieving information or performing any operations on the data table, for example, you may need to check the size of the information stored in the table’s column or increase the … Read more

SQL Server Escape Single Quote in String

SQL Server Escape Single Quote in String Syntax Error

In this SQL Server tutorial, you will learn about SQL Server escape single quote in string with examples. Sometimes, when you want to insert or find the string containing a single quote through the query, and if you don’t know how to handle the single quote in SQL Server, you usually get the error. Here, … Read more

SQL Server Count Characters in String

SQL Server Count Characters in String using the LEN() function

This SQL Server tutorial will teach you about SQL Server count characters in string. You will learn about the two methods, LEN() and DATELENGTH(), to count the number of characters in the given string. SQL Server Count Characters in String Counting characters in a string means checking the length of the given string. Suppose you … Read more

SQL Server Convert Datetime to Date

SQL Server Convert Datetime to Date using CAST Function

In this SQL Server tutorial, you will learn about SQL Server Convert Datetime to date, where you will understand the why to convert the datetime value to date. Then, you will introduced to some function in SQL Server that allows you to convert the given datetime value to date, such as CONVERT(), CAST() and TRY_CONVERT(). … Read more

SQL Server DATETRUNC Function

SQL Server DateTrunc Function Truncating the Year

In this SQL Server tutorial, you will learn about the SQL Server DATETRUNC function, where you will be truncating the part of the given date. After that, you will apply the DATETRUNC() function on the different date string literal and truncate the date to year, month, day, minutes, etc. Ultimately, you will learn to use … Read more

STRING_SPLIT Function in SQL Server

STRING_SPLIT Function in SQL Server

In this SQL Server tutorial, you will learn the STRING_SPLIT function in SQL Server to divide the string based on the specified character. You will understand the benefits of using the STRING_SPLIT() function in SQL Server with its syntax. Then, you will see how the STRING_SPLIT() function works with the help of some examples. After … Read more

SQL Server Remove Character From String

SQL Server Remove Character From String using Replace Function with Special Character

In this SQL Server tutorial, you will understand SQL Server remove character from string. You will learn about the reasons to remove the character from a string, then functions such as REPLACE(), LTRIM(), and RTRIM() that you can use to remove the character from the given string. SQL Server Remove Character From String Removing the … Read more

GROUPING in SQL Server

GROUPING in SQL Server

In this SQL Server tutorial, you will understand GROUPING in SQL Server, where you will learn the syntax of the GROUPING() function and its definition. Then, using an example, you will apply the GROUPING() function on the table column. GROUPING in SQL Server When you perform the aggregation on the table rows with the GROUP … Read more

How to use MIN Function in SQL Server

MIN() Function in SQL Server

In this SQL Server tutorial, you will learn about the MIN function in SQL Server, which is the aggregate function that can find the minimum value. Then, you will understand the syntax of the MIN() function and its definition. Afterwards, you will learn to use the MIN() function with DATE and VARCHAR data types. Finally, … Read more

How to use MAX Function in SQL Server

MAX Function in SQL Server

In this SQL Server tutorial, you will learn about the MAX function in SQL Server, which is the aggregate function that can find the maximum value. Then, you will understand the syntax of the MAX() function and its definition. Afterwards, you will learn to use the MAX() function with DATE and VARCHAR data types. Finally, … Read more