Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

sp_spaceused2

By Jason S Wong,

 BOL ----> sp_spaceused

----------------------------------------------------------------------------------------------------
If objname is specified, the following result set is returned for the specified object.
Column name Data type Description 
name 
nvarchar(128) 
Name of the object for which space usage information was requested.
The schema name of the object is not returned. If the schema name is required, use the sys.dm_db_partition_stats or sys.dm_db_index_physical_stats dynamic management views to obtain equivalent size information.
------------------------------------------------------------------------
That is funny because if you investigate, there is a parsename function which can tell you the schema name. The reason I need schema name and database name is I am automating size report completely in the installed instance regardless which database and/or which table. As you know, S1.table is not the same object as S2.table.
Here is the script. Next step I will publish the script that query all databases and all tables size in the entire installed instance.

Total article views: 1378 | Views in the last 30 days: 2
 
Related Articles
FORUM

how to check the Schema Objects Details in Each Database using SP

Schema Objects History for all Databases

FORUM

COPYING ALL DA THE DATBASE OBJECTS FROM DBO SCHEMA TO NEW SCHEMA

COPYING DB OBJECTS TO A NEW SCHEMA

FORUM

How to find out the Objects Defacults Schema Details

How to find out the Objects Defaults Schema Details

FORUM

How to sync database schema from a database to another?

sync database design, database schema

FORUM

dynamic object(database/schema/obj) in stored procedure

how to reference multiple database/objects in stored procedure (parameterization)

Tags
monitoring    
size    
space    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones