Author: Yavuz Selim Kart

Seasonal Returning Function in SQL Server

Hello to everyone, In this article, I will give information about the function that brings seasonal information in SQL Server. In SQL Server you may want to fetch seasonal information in some cases. You can easily do this with the help of the function below. CREATE FUNCTION getSeasonInformation ( @Date...

Function to Find Leap Year in SQL Server

Hello to everyone, In this article I will talk about how to find leap years in SQL Server. Leap years are years where an extra, or intercalary, day is added to the end of the shortest month, February. The intercalary day, February 29, is commonly referred to as leap day....

Find Stored Procedure Related to Table in SQL Server

Hello to everyone, In this article, I will talk about how to find the tables used by Stored procedures in SQL Server. You can easily do this using the code below. DECLARE @temptableforSP TABLE ( spName VARCHAR(100), tableName NVARCHAR(100) ); DECLARE @SP_Name AS NVARCHAR(100); DECLARE @SP_Cursor AS CURSOR; SET @SP_Cursor...

Finding Week Start and End Dates in SQL Server

Hello to everyone, In this article, I will give you information about how to get the start and end date information of the week in SQL Server. By default, SQL Server week start date is Sunday. You can also do this using the code below. DECLARE @dateTimeNow DATETIME = GETDATE(); SELECT...

Set First Day of the Week in SQL Server

Hello to everyone, In this article, I will give you information about how to assign the first day of the week information in SQL Server. You may want to change the first day of the week in SQL Server. The DATEFIRST statement sets the first day of the week for...

Function to Calculate Body Mass Index in SQL Server

Hello to everyone, In this article, I will talk about the function that calculates Body Mass Index in SQL Server. I felt the need to write because I could not find an article or example written on the subject. This is the first post in its field. You may want...

Word Counting Function in SQL Server

Hello to everyone, In this article, I will talk about the use of word counting functions in SQL Server. In SQL Server you may want to find the number of words in a given sentence in some cases. You can easily do this using the function below. CREATE FUNCTION [dbo].[WordCount]...

Don`t copy text!