MSSQL Query Blog

Seeing Compatibility Levels of All Databases in SQL Server

Hello to everyone, In this article, I will give information about how to see the Compatibility Levels of all databases in SQL Server. You may want to see the Compatibility Levels of all databases before and after upgrades in SQL Server. You can easily do this using the code below....

Seeing Table Sizes in SQL Server

Hello to everyone, In this article, I will give information about how to see table sizes in SQL Server. In SQL Server you may want to see table sizes in some cases. You can easily do this using the code below. SELECT t.name AS TableName, s.name AS SchemaName, p.rows, SUM(a.total_pages)...

Converting Gregorian Date to Hijri Date in SQL Server

Hello to everyone, In this article, I will give information about converting Gregorian date to Hijri date in SQL Server. In SQL Server, in some cases, you may want to convert the Gregorian date to the Hijri date. You can easily do this using the code below. DECLARE @DateTime AS...

Seeing Each Database and Its Disk Size in SQL Server

Hello to everyone, In this article, I will give information about seeing each database and the size of the disk it is on in SQL Server. In SQL Server, in some cases you may want to see each database and the size of the disk it is on. You can...

Disable Auto Shrink of All Databases in SQL Server

Hello to everyone, In this article, I will give information about disabling Auto Shrink of all databases in SQL Server. In SQL Server, in some cases, you may want to disable Auto Shrink for all databases. You can easily do this using the code below. DECLARE @name VARCHAR(500); DECLARE @sql...

Listing All Subfolders in Main Folder in SQL Server

Hello to everyone, In this article, I will provide information about listing all subfolders in the main folder in SQL Server. In SQL Server, in some cases, you may want to list all subfolders within the main folder. You can easily do this using the code below. DECLARE @Table TABLE...

Don`t copy text!