Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 33247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:53:27+00:00 2026-05-10T13:53:27+00:00

I think most people know how to do this via the GUI (right click

  • 0

I think most people know how to do this via the GUI (right click table, properties), but doing this in T-SQL totally rocks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T13:53:28+00:00Added an answer on May 10, 2026 at 1:53 pm
     CREATE TABLE #tmpSizeChar (      table_name sysname ,      row_count int,      reserved_size varchar(50),      data_size varchar(50),      index_size varchar(50),      unused_size varchar(50))                                CREATE TABLE #tmpSizeInt (      table_name sysname ,      row_count int,      reserved_size_KB int,      data_size_KB int,      index_size_KB int,      unused_size_KB int)     SET NOCOUNT ON INSERT      #tmpSizeChar EXEC      sp_msforeachtable 'sp_spaceused ''?'''       INSERT INTO #tmpSizeInt (         table_name,         row_count,         reserved_size_KB,         data_size_KB,         index_size_KB,         unused_size_KB         ) SELECT  [table_name],         row_count,         CAST(SUBSTRING(reserved_size, 0, PATINDEX('% %', reserved_size)) AS int)reserved_size,         CAST(SUBSTRING(data_size, 0, PATINDEX('% %', data_size)) AS int)data_size,         CAST(SUBSTRING(index_size, 0, PATINDEX('% %', index_size)) AS int)index_size,         CAST(SUBSTRING(unused_size, 0, PATINDEX('% %', unused_size)) AS int)unused_size FROM #tmpSizeChar     /* DROP TABLE #tmpSizeChar DROP TABLE #tmpSizeInt */  SELECT * FROM #tmpSizeInt ORDER BY reserved_size_KB DESC 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As I think most people know already, or if you don't, FPDF released a
I feel like this may be a trivial problem for most people but I'm
I think I probably know that the most common suggestion will be change the
I think I've settled on this as the most simple and unit-testable method for
I've been working on this problem most of the morning and I think I
I want to know how most people are dealing with the repository pattern when
I know this sort of question has been asked before , but I still
I recently learned about Java's security model. Most people think Java is secure because
I think the title says most of my problem. I am new to C
Talking about SimpleModal the jQuery plugin. Most of the time I think it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.