In this blog. Today I am determining all database files (data, logs) size and growth in SQL Server below given Query. This query show file group of the all database in Existing server and we can find the location where it's located in system.
CREATE TABLE #temp
(
Databasename VARCHAR(100),
Name VARCHAR(1000),
Fileid INT,
Filename VARCHAR(500),
Filegroup VARCHAR(100),
Size VARCHAR(200),
Maxsize VARCHAR(300),
Growth VARCHAR(100),
Usage VARCHAR(100)
)
DECLARE @database VARCHAR(100)
DECLARE cur CURSOR FOR
SELECT name
FROM master..sysdatabases

Join the conversation! Your thoughts help the community grow.