All about database size, file size & table size in SQL Server

Spread the love

Introduction

In this article, we will try to pull all sizes from SQL server. How to find Database Size in SQL Server? How to Get size of all tables in the SQL Server database? We will use different SQL Queries to find Database file size, database size, and tables size. Very often we need to check the size of the Database whenever we plan to move our entire database or file or only tables from one server to another server. Using these queries above mention task will easier for us.

Script 01

Below script is to find DATABASE NAME, LOG SIZE in MB, ROW SIZE in MB & TOTAL SIZE in MB for a particular database.

Result

Script 02

Below script is to find Database Name, Logical Name & Physical location for a particular database.

Result

Script 03

Very often DBAs needs to know about the largest table size in the database. Following SQL query is used to find the largest table in the Database.

Result


Spread the love
Author: OTi
Meet OTi, the brains behind the popular tech blog "OurTechIdeas.com." OTi is an accomplished author, tech enthusiast, and an expert in SQL Server. With over a decade of experience in the tech industry, he has become a trusted voice in the world of database management. OTi's passion for technology began at a young age, and he has been tinkering with computers ever since. He graduated with a degree in Computer Science and has since worked for some of the biggest tech companies in the world. His experience has given him a deep understanding of how technology works and how it can be used to improve our lives.

1 thought on “All about database size, file size & table size in SQL Server

Leave a Reply

Your email address will not be published. Required fields are marked *