GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  SQL
Next Question 
 SQL  |  Question 1 of 185    Print  
How to List the  Tables with less than 100Mb Size

  
Total Answers and Comments: 2 Last Update: June 06, 2007   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 27, 2005 17:01:44   #1  
Priya        

RE: How to List the  Tables with les...
select segment_name from dba_segments where bytes/1024/1024<100;
 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
June 06, 2007 04:37:56   #2  
Genie Cool        

RE: How to List the  Tables with les...

If you are trying SQL Server 2000, try the code that gives the size in bytes...

DECLARE @CalSize TABLE
(
 TabID INT,
 ColSize INT
)

INSERT INTO @CalSize
 SELECT A.id, SUM(A.Length) As Length
 FROM
  (Select Length, id from syscolumns) A
 INNER JOIN
  (select id from sysobjects where type = 'U') B
 ON
  A.id = B.id
 GROUP BY A.id

SELECT * FROM @CalSize

DECLARE @RowSize TABLE
(
 TabID INT,
 RowSize INT
)

INSERT INTO @RowSize
 SELECT A.id, A.Row
 FROM
  (SELECT SUM(ROWS) as Row, id FROM SYSINDEXES where indid = 0 GROUP BY ID) A
 INNER JOIN
  (SELECT Tabid from @calSize) B
 ON
  A.id = B.Tabid

Select * from @RowSize

SELECT C.name as TableName, (A.Colsize * B.RowSize) as 'Size'
 FROM
  @CalSize A
 INNER JOIN
  @RowSize B
 ON
  A.Tabid = B.Tabid
 Inner join
  SysObjects C
 On
  C.id = A.TabID
 



 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : If you are trying SQL Server 2000, try the code that gives the size in bytes...DECLARE @CalSize TABLE( TabID INT, ColSize INT)INSERT INTO @CalSize SELECT A.id, SUM(A.Length) As Length FROM  (Select Length, id from ...

Hey there SQL MASTERS, here are some questions i was posed in an interview/assessment thing, dunno how well i did....Coud u answer these questions? i dont know how easy/difficut they are for u, all i know is that i had SERIOUS trouble with them! thanks alot!EMPLOYEEEmployee_id number NOT NULL (Primary Key)Employee_name VarChar(30) NOT NULL Dept_id number NOT NULL (Foreign Key to DEPARTMENT)Manager_id number NOT NULL (Foreign Key to EMPLOYMENT)Salary number
Read Answers (6) | Asked by : zen

I am writing a script to update a value in an Oracle table. The script has a 'From' clause which Oracle does not like. Is there another way to write this since I am bringing data from 3 different tables.ThanksSamir
Read Answers (1) | Asked by : Samir

Giving two tables:EmpCustEmpName, CustID, EmpIDApril, 1, AApril, 3, AApril, 2, ABruce, 4, BBruce, 5, BCarson, 2, CCarson, 1, CCarson, 3, CDavid, 2, DCustReviewCustID, ReviewDate, EmpID1, 01-05-06, A1, 12-13-05, C2, 07-04-04, A2, 05-21-03, C2, 04-02-03, D3, 10-10-02, A3, 02-01-06, C4, 01-01-06, B5, 12-12-04, BWrite a SQL statement that return each EmpName and LATEST ReviewDate. Result should look like this:EmpName, ReviewDateApril, 01-05-06Bruce, 01-01-06...
Read Answers (2) | Asked by : zanhsieh

My problem is i have a two tablestable1customercustid custnametable2custaddrcustaddrid custaddrstr custid datei have different records for each custid in custaddr table. say for example for the first customer we have 6 records in custaddr table. so i want the latest dated record from the custaddr table. ie to find the maximum date. pls somebody can write the query for this, i have tried but not able to find the max of the dates.thanks in advance

1. No of User variables in sql*plus is ?2. User can have __ many number of variables per sql command.3. User can have__ many number of lines (assuming 80 characters per line) per sql command.4. The size of PL/SQL buffer in Oracle 7 is 2k and in Oracle6 is 512k oracle 9 is?
View Question | Asked by : SHASHIDHAR B.N

Hi,Select * from tab; - means we can see all the tables,right!is there any option similar to this..?
Read Answers (7) | Asked by : developer

Hi This is Srini .i want backup datbase from tables for certain time . how to write query in sqlserver.
View Question | Asked by : srini
Tags : Backup

I hve two tables EMP1&EMP2 both having same fields if any updations made in emp1 how to reflect on emp2
Read Answers (5) | Asked by : ramarao

Latest Answer : Tables once dropped are permanently removed from database and hence they are stored no where in database. ...
Read Answers (3) | Asked by : swapna


 Sponsored Links

 
Related Articles

Importance of Strong Vocabulary

Why Having a Strong Vocabulary is So Important In addition to your appearance and the way you carry yourself people will judge you based on the words that come out of your mouth Even if you are a mathematical genius having a poor vocabulary will send across a message that you re not very intelligent
 

List of Popular Scholarship and Grants

List of Popular Scholarship and Grants There are a number of popular scholarships and grants that students will want to look for While obtaining these scholarships can be challenging the rewards are well worth it One of the largest sources of both scholarships and grants is the U S Department of Edu
 

The Importance Of a To-Do List

The Importance Of a To Do List A To Do list is a list of important tasks that you will need to carry out within a given period of time They are a crucial tool for those that want to be skilled at time management The concept of a To Do list is quite simple mosgoogle By having all of the things you ne
 

How Leaders Can Build A Strong Team

How Leaders Can Build A Strong Team To be a great leader you will want to build a powerful team It doesn t matter how successful you are or plan to be To succeed you must know how to assemble the best people This is important whether you are a coach general or corporate executive mosgoogle The team
 

How To Create High Quality Tables With JavaScript

How To Create High Quality Tables With JavaScript If you are web program developer it is likely that you are creating tables on a daily basis In this article I will show you how to create high quality tables with Javascript within a short period of time One feature that you will want to become famil
 

CSS Tutorials : Lesson 10 : Cascading Style Sheets (CSS) List

CSS Tutorials Lesson 10 List In this tutorial you will learn about Cascading Style Sheets CSS List List style type List style position List style image and Using the shortcut mosgoogle List style type To set the list style marker type use the property list style type&rdquo; this property can
 

Oracle 10g Tutorials -Creating Index-Organized Tables

Oracle 10g Free Training Creating Index Organized Tables Let us learn about Creating Index Organized Tables by Creating an Index Organized Table further by Creating Index Organized Tables that Contain Object Types and also you will learn how to View Information about Tables mosgoogle Creating Index
 

Oracle 10g Tutorials: Altering Tables

Oracle 10g Free Training Altering Tables In this training you will learn about Altering Tables Modifying an Existing Column Definition Adding Table Columns Renaming Table Columns Dropping Table Columns Removing Columns from Tables Marking Columns Unused and Removing Unused Columns Oracle 10g Free Tr
 

Oracle 10g Tutorials : Dropping Tables

Oracle 10g Free Training Dropping Tables In this training you will learn about Dropping Tables Consequences of Dropping a Table CASCADE Clause and the PURGE Clause mosgoogle Dropping Tables To drop a table that you no longer need use the DROP TABLE statement The table must be contained in your schem
 

Oracle 10g Tutorials : Creating Tables

Oracle 10g Free Training Creating Tables In this training you will learn about Creating Tables and Parallelizing Table Creation mosgoogle Creating Tables To create a new table in your schema you must have the CREATE TABLE system privilege To create a table in another user s schema you must have the
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape