dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Intermediate
Dec 22, 2016

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


The sp_MSforeachdb Stored Procedure

The sp_MSforeachdb stored procedure helps you to do repetitive actions against all or some of the SQL Server instance databases.

For example, this query:

EXEC sp_MSforeachdb 'USE [?]; EXEC sp_spaceused'

Displays the space used (Reserved space, Data, index Size, Unused Space) by each database.

Hannes du Preez
 
Thanks for your registration, follow us on our social networks to keep up-to-date