MSSQL Query Blog

Finding Increment Amount of Table in SQL Server

Hello everyone, In this article, I will try to give information about finding the increase amount of the table in SQL Server. In SQL Server you may want to find the increment amount of the table in some cases. You can easily do this using the code below. SELECT IDENT_INCR(‘Categories’)...

Writing an Oracle INITCAP Function in SQL Server

Hello everyone, In this article, I will give information about writing the Oracle INITCAP function in SQL Server. In SQL Server, in some cases, we may want to see and use functions that exist in other databases. What is the INITCAP function? While the INITCAP function converts the first character...

Writing a LastIndexOf Function in SQL Server

Hello everyone, In this article, I will try to give information about writing the LastIndexOf function in SQL Server. First of all, there is no such function in SQL Server. Before writing the function, let’s get a brief overview of the CHARINDEX function. In SQL Server, the CHARINDEX function performs...

Function to Check Mail in SQL Server

Hello everyone, In this article, I will try to give information about the function that checks mail in SQL Server. In some cases, you may want to check the e-mail address you have in SQL Server. You can easily do this using the function below. CREATE FUNCTION fn_eMailKontrol ( @EmailAddr...

Equivalent of Oracle LAST_DAY Function in SQL Server

Hello everyone, In this article, I will give information about the equivalent of the Oracle LAST_DAY() function in SQL Server. In SQL Server, in some cases, we may want to see and use functions that are in other databases. What is the LAST_DAY() function? The LAST_DAY() function returns the date...

Shrinking Tempdb Database in SQL Server

Hello everyone, In this article, I will try to give information about shrinking the Tempdb database in SQL Server. In SQL Server, in some cases, you may want to shrink the Tempdb database. You can easily do this using the code below. CHECKPOINT; GO DBCC DROPCLEANBUFFERS; GO DBCC FREEPROCCACHE; GO...

Encryption Operations in SQL Server

Hello everyone, In this article, I will try to give information about encryption operations in SQL Server. In SQL Server, in some cases, you may want to encrypt the data you have. You can easily do this using the code below. DECLARE @TestData NVARCHAR(MAX) = N’Yavuz Selim Kart’; SELECT HASHBYTES(‘MD2’,...

Don`t copy text!