Finding Table , Database Size

Sep 29, 2005

Hii all,

I want to find the database , table size in MS SQL Server.

Is there is any query /procedures to find out the database and table size.

Thanks in advance .,

Regards.,

Sri

View 5 Replies


ADVERTISEMENT

Finding The Size Of A Table?

Oct 12, 2007

Hi All,

Do any of you know how I can find the size of a table in SQL server?

Cheers

Dave

View 3 Replies View Related

Finding Database Size In SQL Express

May 9, 2006

Our system guy wants me to find out just exactly how much room is being taken up by the SQL Express databases (I am using two). I am not sure how to do this. Is there any way to find the size, or, lacking that, how many records overall? We will probably need to move up to SQL 2005 soon, but he needs to figure out the memory requirements, etc.

Thanks,

Michael

View 3 Replies View Related

Finding Out Physical Size Of Table On Disc

Jan 26, 2012

If I have a table of 1,000,000 rows how I do find out what size this table is on disk?

And how do I find out the size of all tables on disc?

View 2 Replies View Related

Table Size And Database Size

Mar 2, 2008

Hi,
i use this script that show me the size of each table and do the sum of all the table size.

SELECT
X.[name],
REPLACE(CONVERT(varchar, CONVERT(money, X.[rows]), 1), '.00', '') AS [rows],
REPLACE(CONVERT(varchar, CONVERT(money, X.[reserved]), 1), '.00', '') AS [reserved],
REPLACE(CONVERT(varchar, CONVERT(money, X.[data]), 1), '.00', '') AS [data],
REPLACE(CONVERT(varchar, CONVERT(money, X.[index_size]), 1), '.00', '') AS [index_size],
REPLACE(CONVERT(varchar, CONVERT(money, X.[unused]), 1), '.00', '') AS [unused]
FROM
(SELECT
CAST(object_name(id) AS varchar(50)) AS [name],
SUM(CASE WHEN indid < 2 THEN CONVERT(bigint, [rows]) END) AS [rows],
SUM(CONVERT(bigint, reserved)) * 8 AS reserved,
SUM(CONVERT(bigint, dpages)) * 8 AS data,
SUM(CONVERT(bigint, used) - CONVERT(bigint, dpages)) * 8 AS index_size,
SUM(CONVERT(bigint, reserved) - CONVERT(bigint, used)) * 8 AS unused
FROM sysindexes WITH (NOLOCK)
WHERE sysindexes.indid IN (0, 1, 255)
AND sysindexes.id > 100
AND object_name(sysindexes.id) <> 'dtproperties'
GROUP BY sysindexes.id WITH ROLLUP) AS X
ORDER BY X.[name]

the problem is that the sum of all tables is not the same size when i make a full database backup.
example of this is when i run this query against my database i see a sum of 111,899 KB that they are 111MB,but when
i do full backup to that database the size of this full backup is 1.5GB,why is that and where this size come from?

THX

View 5 Replies View Related

Finding Row Size

Oct 7, 2004

Hi,
Anyone got any ideas how to calculate the occupied row size of a table?

View 1 Replies View Related

Help Finding Current Size Of A Field

Jan 19, 2006

How do I find the current size of each field in a table's column?

I have a table with a field for notes/memos. I need to see which ones are about to reach the size limit and what the current size is.

Does this make sense?

Thank you,
Karen

View 2 Replies View Related

SQL Server 2008 :: Finding Backup File Size In Advance?

Mar 8, 2015

My backups are failing sometimes.My db size is around 400 GB and we are taking backup to the remote server. Free size available on the disk is showing 600 GB but my database full backup run more than 10 hrs and failed. The failure reason is there is not enough space on the disk.

What could be the possible failure reasons? It has more than the the database size on the backup server but why it is showed that msg on the job failures. I noticed same thing occurred couple of times in the past.

Is there any way to find how much the backup file will be generate before we run the backup job?

i.e. If we run the full backup of test1 database now, it will generate ....bak file for that test1 db

currently we are using maintenance plan and with compression (2008R2) and the database has TDE enabled

View 3 Replies View Related

SQL Server Admin 2014 :: Possible To Find Table Size And In That Table Each Row Size

Jun 10, 2014

It is possible to find table size and in that table each row size.

View 4 Replies View Related

How To Report The Size Of Each Table In A Database?

Jul 23, 2005

Hey guys,Does anyone know a way (in Enterprise Manager or thru a SQL statement)to get the number of rows and the size of each table in a database?Thks,

View 2 Replies View Related

Size Occupied Of The Table In Database.

May 13, 2008



Hi all

How to find out size occupied of the table in Database in SQL Server2000

Help me reg.

View 5 Replies View Related

Create List Of Table Names And Size For A Database

May 5, 2004

Hi there,

I am trying to create a list of all the tables in one database and then list the size of each table. So for example I want to create a table with the table name and table size for one DB

E.g

Table1 1111KB
Table2 123300MB
Table3 120448KB

etc for all the tables in a particukar DB

I know there is a stored procedure to list the sizes: 'sp_spaceused' but not sure how to script all this together.

can anyone help please!!

From

NewToSQL

View 12 Replies View Related

SQL Server Admin 2014 :: Table Size Difference In Two Database

Jul 20, 2015

I am having an issue in determining the correct size of a table.

I have a tableA in some DB on transaction server (Enterprise Edition), this table is being replicated in reporting server DB (Standard edition).

When I check the space used by this table in both the databases i see noticeable difference.

I am using EXEC sp_spaceused 'tableA' to determine the space.

Transaction Server
------------------------------------------------------------------------------
name rows reserveddata index_size unused
TableA1439999 695416 KB507048 KB182912 KB 5456 KB

Reporting Server
-------------------------------------------------------------------------------
name rows reserveddata index_size unused
TableA1439999 656904 KB483664 KB172680 KB 560 KB

So I wanted to know what could be the possible reasons for this difference ?

View 5 Replies View Related

Finding Rows In One Table But Not In Another Table Based On 2 Fields

Apr 23, 2008



I have 2 tables with 2 fields in common between them. How do I get a count of rows in table 1 but not in table 2 matching those 2 fields? Thanks.

View 7 Replies View Related

Transact SQL :: Finding Calling Database In A Sproc Called From A Different Database?

Apr 21, 2015

I'm trying to figure out how to identify the calling database within a sproc on a different database without using a parameter.

View 2 Replies View Related

SQL 2005 Resize Initial Log Size: MODIFY FILE Failed. Specified Size Is Less Than Current Size.

Sep 4, 2007


I am trying to resize a database initial log file from 500M to 2M. I€™m using€?

ALTER DATABASE <DBNAME> MODIFY FILE ( NAME = <DBLOGFILENAME, SIZE = 2 ) "



And I'm getting "MODIFY FILE failed. Specified size is less than current size." I tried going into the database properties and setting the log file to 2M, but it doesn€™t keep the changes.



Any help with this process?

View 1 Replies View Related

Finding The Table Name.

Dec 15, 2006

I have a script that creates these spin off tables (used for lightning fast access) on a near daily basis. But it is possible the table does not exist for that day - in which the script need to check one day back - so on and so forth until finding the most recently created table.

The script I have written fails with overflow error.
I was hoping someone could tell me the correct syntax to accomplish this and also why i recieve this overflow error...


Code:


Dim str_SQL_Asset_1
daysBack = 1
tblFound = FALSE
Dim xbl_Holdings_date
Dim xMonth
Dim xDay
xbl_Holdings_date = date()
If Len(Month(xbl_Holdings_date))=1 Then
xMonth = "0" & Month(xbl_Holdings_date)
Else
xMonth = Month(xbl_Holdings_date)
End If
If Len(Day(xbl_Holdings_date))=1 Then
xDay = "0" & Day(xbl_Holdings_date)
Else
xDay = Day(xbl_Holdings_date)
End If

DO WHILE tblFound = FALSE
xbl_Holdings_Name = "xbl_Holdings_" & Year(xbl_Holdings_date) & "_" & xMonth & "_" & xDay
SQL_tblCheck_STR = "SELECT * FROM INFORMATION_SCHEMA.TABLES " & _
"WHERE table_name = '" & xbl_Holdings_Name & "' "

Set MM_checkCmd = Server.CreateObject("ADODB.Recordset")
MM_checkCmd.ActiveConnection = conn_str_ClientDB
MM_checkCmd.Source = SQL_tblCheck_STR
MM_checkCmd.CursorType = 0
MM_checkCmd.CursorLocation = 2
MM_checkCmd.LockType = 3
MM_checkCmd.Open()


IF MM_checkCmd.EOF Then
xbl_Holdings_date = (xbl_Holdings_date - daysBack)
daysBack = daysBack + 1
tblFound = FALSE
ELSE
tblFound = TRUE
MM_checkCmd.CLOSE()
SET MM_checkCmd = Nothing
END IF
loop



The goal of this snippet is simply to identify and set the value for the existing table name.
An example table name would be "xbl_Holdings_2006_12_10".

I could have posted this question in the VB forum but I would like to push as much of the work onto SQL as possible and also - this sort of operation is more likely to be required of a dba imo.

View 1 Replies View Related

Finding Table Names

Jun 29, 2006

Is there a way i can create a query that gives me a list of all the table names in the database?

View 2 Replies View Related

Finding The Primary Key Of A Table.

Dec 3, 2007

I'm trying to find the primary key on a given table in SQL Server 2000 using SQL.  I'm querying the sysobjects table to find a given table, and then querying the sysindexes table.  I've ALMOST found what I'm looking for.   I see the indexes and columns etc. on the tables in the database, I just don't see the field that indicates that the index is the primary key.
Can anyone help?
Thanks, Alex

View 6 Replies View Related

Finding Out Table Names

Jul 20, 2005

I'm fairly new to sql.I've got a database that all I want to do is view some records fromsome tables. But the thing is, I do not know the table names ortheir relationships.I've got access to the database thru query analyzer. Can someoneassist me in gettign the correct statements that will allow me to findout what tables exist in the database.

View 4 Replies View Related

Finding Rows Within A Table

Jun 25, 2007

When I open a table and need to make a change within a particular record...



How do I find the particular row that I am looking for? I seem to have to scroll through 600 records to find the one I need. I've found a search and replace function but it doesn't seem to work.



Thanks I appreciate any advice you can give me.



View 3 Replies View Related

Finding Table Names

Feb 19, 2008

I'm new here so bare with me for alittle bit.
When I go to a website how to I find out the table names in the data?

I mean how can I do "select * from ___" if I don't know the table name.

Thank you for any help,
S_R_S

View 5 Replies View Related

Finding Out Database Configuration

Jun 12, 2003

Hi,

I'm new to SQL 2000 administration and would like to know how to find out what the existing SQL Server Database configurations and what installation options has been installed / selected.

Thanks

Murras68

View 1 Replies View Related

Finding Data In SQL Database

Feb 23, 2006

I have like 20 databases on my SQL Server. I have like 30 tables in each Database. I would like to find out all the rows in all tables in all database that has a certain text?

Is this possible?

Thanks in Advance
Yalgaar

View 2 Replies View Related

Finding Data In SQL Database

Feb 24, 2006

Sorry to repost this again since I did not get any replies on my previous post.

I would like to know if there is any way to find out if a string "ABCD" exist in any rows, any tables, any database?


Thanks

View 6 Replies View Related

Finding A Column In A Database

Jul 23, 2005

Hi all,How do I find all tables containing a column (say a column includingthe string 'value')?ThanksBruno

View 2 Replies View Related

Stored Proc Not Finding Table

Jul 17, 2005

Need some suggestions on what to check or look for.My stored proc is not finding the table in the sql db.  This is the error...Invalid object name 'tblServRec'I use the same function to pass in an arraylist and the sp name for another sp and that one works ok.The sp is the same as another one except for the table name and that one works ok.The sp works fine on my local machine.  It finds the table ok.  But when I try it on the server, it doesn't work.I have checked permissions, and they are the same for all tables, even the one that the other sp works ok on the server.Here is the sp if that will help.....CREATE PROCEDURE dbo.deleteServRec
@fldNum    INT  ASBEGIN DECLARE @errCode   INT
 DELETE FROM tblServRec WHERE fldNum = @fldNum     SET @errCode = 0 RETURN @errCode
HANDLE_APPERR:
 SET @errCode = 1 RETURN @errCodeENDGOThanks all,Zath

View 4 Replies View Related

Finding Last DDL Activity Time In A Table

Nov 1, 2001

Hi Friends,

Is there any way to find the time when the last DDL was happened in a table?
For example: The time when the new column(s) were added into a table or changed the datatype.

Thanks for the help in advance.

--Raj

View 1 Replies View Related

Finding Table Modification Date

Oct 10, 2001

Is there a way to find out when the last modification or change to data in a table occured ? How about the last change of a view ?

We'd like to be able to extract data to another table based on a view. Then, at a later date, check to see if the first table or view has changed since the last extract. If not, then we don't need to re-extract the data, we know it hasn't changed.

View 1 Replies View Related

Finding Out Which Rows Have Been Updated In A Table

Feb 9, 2005

Can this be done easilly through a stored proc?

View 1 Replies View Related

Finding Lowest Value In A Table Greater Than A Certain Value?

Dec 19, 2013

finding the first value to cross a specific threshold in SQL Server

LoadTemp1 LoadTemp2 LoadTemp3 TimeStamp
300 350 200 12-10-2013 13:30
177 238 333 12-10-2013 13:05
240 190 170 12-10-2013 12:45

How do I design query to find the first LoadTemp* that cross a threshold of 340 degrees per TimeStamp.

View 6 Replies View Related

Finding Products Code With A Table

May 29, 2008

Hi i've to table where i have a product code and a area code.

I want to insert the values from table 1 into table 2 if the product code and area code do not already exists in the table in table 2.

Am using this code below but it does not seem to be working.

select distinct p_code1, area_code
from table1
where not exists
(select p_code, area_code
from table 2 )

View 2 Replies View Related

Finding Suspected Abuse From Log-table

Jun 17, 2008

A client has a site, that requires users to log in, and each login is logged with IP in this table:

CREATE TABLE [dbo].[Event](
[EventId] [int] IDENTITY(1,1) NOT NULL,
[EventTypeId] [int] NOT NULL,
[IP] [varchar](50) NULL,
[UserId] [int] NULL
[DateCreated] [datetime] NOT NULL CONSTRAINT [DF_Event_DateCreated] DEFAULT (getdate()),
CONSTRAINT [PK_Event] PRIMARY KEY CLUSTERED
(
[EventId] ASC
)

How the client wants me to write a query, that will find "suspected abuse of accounts" - defined by being successful logins made within one hour from at least 3 different IPs.

So I need to check for events, that are within one hour from each other (datecreated field) and have the same userID - and EventTypeId - but at least 3 different IPs.

Maybe it's just late in the day or I am overworked, but I cant seem to find an effective way to approach this.

Ideas?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved