The Internet of Things (IIoT) offers unprecedented possibilities for industries. Stay ahead with EcoStruxure™ Plant and Machine.Learn more
...with the EcoStruxure™ Facility Expert (formerly known as Facility Hero) app in hand! Discover how you can optimize your maintenance efforts today.Learn more
Access tailored services, 24/7 self-service and expert help. Anywhere, anytime, any project.Discover now
The story behind the Shedd Aquarium, a smart, sustainable facility that connects people to animals, with EcoStruxure™.Discover how
Welcome to the Schneider Electric Global Website×
Goals and Symptoms
Determine size of tables in a SQL database.
Facts and Changes
ION Enterprise 6.0, Database Space, Database Size, Table Size, Archive Trim, sp_spaceused
Causes and Fixes
To look at a single table in a Database
1. In the SQL Server Management Studio start a new query and change the name of the database (<dbname>) and table (<tablename>).
2. Then press "Execute"
To look at all the tables in a Database
1. In the SQL Server Management Studio start a new query.
2. Paste the following script in the New Query Window and change the name of the database (<dbname>) in the first line.
ifexists(select name from tempdb..sysobjectswhere name='##tmp')
createtable ##tmp(nam varchar(50),rowsint, res varchar(15),data varchar(15),ind_sze varchar(15),unsed varchar(15))
declare @tblname varchar(50)
declare tblname CURSORforselect name fromsysobjectswhere xtype='U'
Fetchnextfrom tblname into @tblname
FETCHNEXTFROM tblname INTO @tblname
select nam Table_Name,rows Total_Rows,res Total_Table_Size,data Data_size,ind_sze Index_Size,unsed Unused_Space from ##tmp
3. Then press "Execute"
Sign up for all the latest solutions, offers and best practices straight to your inbox.
We are excited that you have joined the group. You will receive your welcome email soon describing the program and what to expect in the upcoming weeks. Enjoy!