Solved

SQL Server Capacity Script & Database Growth Script?

Posted on 2011-09-20
4
345 Views
Last Modified: 2012-05-12
Does anyone have a procedure that will give me all SQL Server database size, server name, file location and how much space is available on the drive that the database resides on? Also I need a script that will track database growth daily, weekly and monthly. The version of SQL this will be used for is SQL Server 2005 and 2008. Please advise.
0
Comment
Question by:Omega002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
rajvja earned 500 total points
ID: 36568098
Hi

USE AdventureWorks2008R2;
GO
EXEC sp_spaceused N'Purchasing.Vendor';
GO

this will get the space used for the DB
0
 

Author Comment

by:Omega002
ID: 36568180
I need one for all databases
0
 
LVL 11

Assisted Solution

by:rajvja
rajvja earned 500 total points
ID: 36568285
EXEC sp_msforeachdb @command1="use ? exec sp_spaceused"
0

Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question