Category: SQL Server

Listing Weekends of Selected Years in SQL Server

Hello everyone, In this article, I will try to give information about listing the weekends of selected years in SQL Server. In SQL Server, in some cases you may want to list the weekends of selected years. You can easily do this using the code below. DECLARE @startDate DATETIME, @endDate...

Listing All Time Between Two Dates in SQL Server

Hello everyone, In this article, I will try to give information about listing all the times of the day between two dates in SQL Server. In SQL Server, in some cases you may want to list all the times between two dates. You can easily do this using the code...

Finding Rows with Lowercase Letters in SQL Server

Hello everyone, In this article, I will try to give information about finding rows containing lowercase letters in SQL Server. In SQL Server, in some cases, you may want to find rows containing lowercase letters. You can easily do this by revising the sample code below. SELECT * FROM Customers...

Viewing Table Based Index Information in SQL Server

Hello everybody, In this article, I will try to give information about displaying table-based Index information in SQL Server. In SQL Server, in some cases, you may want to display table-based Index information. You can easily do this using the code below. SELECT sys.objects.object_id, sys.objects.name AS tablename, sys.indexes.name AS indexname,...

Leap Year Checking Function in SQL Server

Hello everybody, In this article, I will try to give information about the leap year control function in SQL Server. In SQL Server, in some cases, you may want to check for leap years. You can easily do this using the function below. CREATE FUNCTION dbo.IsLeapYear ( @year INT )...

Checking Index Fragmentation by Name in SQL Server

Hello to everyone, In this article, I will try to give information about Index fragmentation control by name in SQL Server. In SQL Server, in some cases, you may want to check Index fragmentation by name. You can easily do this using the code below. SELECT dbschemas.[name] as ‘Schema’, dbtables.[name]...

Don`t copy text!