MSSQL Query Blog

Finding Unused Index in SQL Server

Hello everyone, In this article, I will try to give information about finding Unused Index values in SQL Server. In SQL Server you may want to find unused Index values in some cases. You can easily do this by using the script below. SELECT TOP 25 o.name AS ObjectName, i.name...

Dropping Temporary Table in SQL Server

Hello everyone, In this article, I will try to give information about how to drop Temp tables in SQL Server. You can easily do this using the code below. CREATE TABLE #TempTable ( ID INT, NameSurname VARCHAR(50) ); IF OBJECT_ID(‘tempdb..#TempTable’) IS NOT NULL DROP TABLE #TempTable; When you run the...

Calculating Available Disk Size in SQL Server

Hello everyone, In this article, I will try to give information about calculating the available disk size in SQL Server. You can easily do this using the code below. SELECT Drive, TotalSpaceGB, FreeSpaceGB, PctFree FROM ( SELECT DISTINCT SUBSTRING(dovs.volume_mount_point, 1, 10) AS Drive, CONVERT(INT, dovs.total_bytes / 1024.0 / 1024.0 /...

Listing Disk Spaces in SQL Server

Hello everyone, In this article, I will talk about how to list disk spaces in SQL Server. In SQL Server, in some cases, it may be desired to display disk spaces with a query. In such cases, we can list the disk spaces using the following query. EXEC master..xp_fixeddrives; When...

Physical Dimensions of Tables in SQL Server

Hello everyone, In this article, I will try to give information about the physical dimensions of Tables in SQL Server. In SQL Server, in some cases, you may want to learn the physical size information of the tables. You can easily do this by using the query below. SELECT t.name...

Listing Active Triggers in SQL Server

Hello everyone, In this section, I will talk about how to list active triggers in SQL Server. In SQL Server, in some cases, it may be necessary to list active triggers for the database. Using the code below, you can list your active triggers for your database. SELECT TAB.name AS...

Function Parses JSON in SQL Server

Hello everyone, In this article, I will try to give information about the function that parses JSON in SQL Server. In SQL Server, in some cases, you may want to parse the JSON data you have. You can easily do this using the function below. CREATE FUNCTION [dbo].[parseJSON] ( @JSON...

Don`t copy text!