Query To Determine Table Size

Mar 7, 2001

Hi all,
I am looking for a query to determine the exact size of a large table.

Thanks
JJ

View 1 Replies


ADVERTISEMENT

How To Determine Size Of Database

Feb 25, 2015

I ran a query to see how big my database on my SQL Server is and do not understand the metrics. I want to see how much of my 10GB database is left.

database_namedatabase_sizeunallocated space
ANTHEMQ 6521.06 MB243.55 MB

reserveddata index_sizeunused
1332304 KB1328168 KB1800 KB 2336 KB

View 3 Replies View Related

Determine File Size.

Aug 30, 2006

Hi all,

Does any one know how to determine file size using SQL stored Procedure or a function?

My requirement is that I need to kill a file from a specific directory if the file size is 0 kb or 1 kb

Any Ideas?

View 20 Replies View Related

How Can I Determine The Size Of A Database?

Mar 8, 2007

Simple question...

When I use the full version of SQL Management Studio, I can run a report to view the size. How can I do this with SQL Mgmnt Express?

View 1 Replies View Related

HOW TO DETERMINE DB SIZE AND MACHINE REQUIREMENTS

Oct 30, 2000

I'm developing a website that will be suported by a SQL Server database. The estimated number of records for that database will be around one million. I'm concerned with the possibility of my machine being unable to respond to the needs of such a database so i decided to acquire a new one. How do i calculate the hard disk and RAM i'm going to need for this database to function properly ? I know that i can make a HD prediction by adding the sizes of each field of my database and multiplying by one million but i don't know how much KBs each field occupy (some of them -few- will even be free text fields). And the RAM ?

Help... Anybody ?

Thanks,
Carlos.

View 1 Replies View Related

Determine The Size Of An Image Datatype

Nov 3, 2004

Is there any method to find out the size of an image datatype currently in the database. For example I have 2 tables that contain the same image, but the archive table is not displaying the same as the main. I am thinking the image file was corrupted somehow but don't know how to check this out.
Any ideas?

View 1 Replies View Related

SQL 2012 :: Determine Size Of Database

Sep 17, 2015

I am working on Sql Server 2012. and I have multiple databases there. Out of those, i want to move one of my databases to other SQL server 2012, For that i was trying to get approximate size of my database on current server. As i don't have the admin rights, so i can't get that. Can i get the approximate size by right clicking on database and by using the size property Under Database category to get the size idea?

View 4 Replies View Related

Determine The Exact Size Of Row Which Contain Text

Mar 15, 2008

Dear All

can any one help me to determine the exact size of existing row contain data type : varchar ?

thanks

View 5 Replies View Related

Get Size Of A Table/query

Sep 15, 2004

Is there a way to get the size of a query of a table?

I know I can use DATALENGTH on every column in my query, but I thought there might be an easier way.

View 9 Replies View Related

Query Size Of Table

Oct 30, 2004

is there an easy way to query the size of a table on disc?

View 3 Replies View Related

Reporting Services :: Determine Objects Inhibiting Horizontal Shrink Of Tablix And / Or SSRS Report Size?

Jun 10, 2015

I am working on complex invoice document that handles various types of invoicing, credit, and progress bill customer facing documents.  I am faced with same problem I see many SSRS devs posting on.  And that is extra blank pages, being generated because the report width exceeds the width of the page.

My problem is I cannot shrink the horizontal width of the tablix and therefore the report width either...

While I would have done things differently if developing from scratch, the tablix in question has only one column and objects contained in rectangles are placed in the row/column cell.....The link to the image below shows the row I am currently working on.  Essentially all the client wants a columnar report with column lines, closed footers, etc...  so rather redoing the whole tablix, which I still might do, I am using rectangles with the column then lining them up.  Anyway, that is a whole 'nuther post.  My specific questions are:  

Invoice in Report Builder

1. In the image I have selected the parent rectangle.  The children are other rectangles and the data is with grandchildren textboxes that exist within those rectangles.  I clearly have a bit of right side white space in the main parent rectangle, but there is no sizing tool on a hover... just move tool.  And if I change the rectangle size in the prop form it just snaps back to the cell width.  How do I size the parent rectangle and keep if from expanding.

Here I am guessing that to actually reduce the horizontal width of tablix and then the report, I have to first decrease the parent width of the rectangles that occur in each row?

View 2 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

Determine Fastest Query In Query Analyzer

Sep 17, 2005

I am trying to determine which of three stored procedure designs arefastest in the Query Analyzer:One query is a straight SELECT query with all desired rows and a dozen(tblName.RowName = @param or @param = Null) filters in the WHEREstatement.One query populates a #Temp table with the UniqueIDs from the resultsof the SELECT query in the above example, then joins that #Temp tableto get the desired rows.One query users EXEC sp_executesql @sql, @paramlist, @paramin which the @param has the dozen filters.What I'm trying to determine is which is the fastest.Each time I run the query in Query Analyzer it returns the samerecordset (duh!) but with much different Time Statistics.Are the Time Statisticts THE HOLY QRAIL as far as determining which isfastest, and what so I want to look at, the Vale or the Average? Inotice there are different numbers of bytse sen and bytes received foreach of the three queries.Any illumination on this is appreciated.lq

View 4 Replies View Related

Determine Query Time

Feb 12, 2008



Hi, I'm sorry if this is the wrong place to ask this question. These forums are overwhelming and I couldn't find the appropriate place to post.

I am wondering if there is some way to determine when a query has completed. What I want to do is use a PleaseWaitButton in asp.net when the user clicks to run a query and have the button reactivate after the query has completed. I know how to set a specific wait time but I do not want the user to have to wait a default time for the query to complete. Any help you may provide would be greatly appreciated.

Thanks!

View 2 Replies View Related

Query To Determine Backups

Mar 6, 2008

I need a query that gets all of the databases on a server and determines if a backup has been taken. I would normally use the jobs query I currently have, but it wouldn't tell me when the last backup was taken for a new database. I think I should be able to use sp_helpdb or some table from the msdb database. Also, this has to work on SQL Server 2000/2005. If anyone has anything I'd be very grateful. Thanks in advance.
-Kyle

View 2 Replies View Related

Using An Array To Determine Query Order??

Oct 17, 2006

Hi.

I have a VB.NET function that returns an array of Integers.
Say, FunArray = [2, 3, 5, 8, 6, 23, 1, 10, 20 , 4, 54]
One characteristic of the array is that no two numbers
repeat - it reflects the IDs of my Users table. And, that
it is not ascending or descending.

What I would like to know is how do I sort my query in
the order of the integers in this array? Ideally, I
would like to use ORDER BY for this query.

thanks in advance.

View 2 Replies View Related

Query To Determine Public Access

Aug 30, 2007

Is there any T-SQL Script or SP that would determine what tables public users have access to? I only ask because I would like to make sure that any users with public rights do not have access to SYSXLOGINS, SYSDATABASES, SYSOBJECTS, SYSCOLUMNS and mswebtasks tables. Thanks
-Kyle

View 2 Replies View Related

A Query To Determine A Role Or Id's Access To An Object... Do-able?

Oct 19, 2007

Hey there.
I must write a stored procedure to update a table and want to make sure the ID used in both Acceptance and Production will have the necessary access.  The ID will inherit it's access to the resource though a ROLE.
Wondering if there are queries out there that can traverse for example, the roles/id's that have access to it... Thx!

View 2 Replies View Related

Determine If Autoincrement Is Set In A Table, Form Asp.net

Nov 15, 2006

I want to access sqlserver table properties from asp.net .How do i know that a table defined in sqlserver has autoincrement field or not.Actually i have to access all the tables in a database and execute different function for table with auto increment on and off.
I am not being able identify this property from codes.Please help.thank you

View 6 Replies View Related

Determine Last Access Of A Database Or Table

Dec 18, 2007

Does anybody know of a way to determine the last date/time a table has been accessed (query/update)? I've done enough research to know that this isn't easy. However, perhaps somebody has figured out a way through some of the stats that SQL Server keeps to determine the last access of a table. I have recently been put on a team that had no DBA and has a number of databases out there. They would like to determine which databases are inactive and get rid of them. I am a developer and haven't had much SQL Server Administration experience. Any info will help greatly! Thanks!   

View 2 Replies View Related

Determine Table Load Order

Nov 23, 2004

Does anyone have a script that analyzes primary and foreign key relationships of tables and produces a suggested load order based upon dependancies?

Thanks,

Fred.

View 4 Replies View Related

Determine Row Of Data In A Table Through SSIS

Jun 13, 2013

I have a requirement based on 2 parts to determine a row of data in a table through SSIS :

a. Work out the LEG_SEQ_NBR of the VESSEL, VOYAGE and LEG already stored in table1.

To do this join table1 and join table2 through BL_ID column.

b. Work out the 2ndVESSEL, 2ndVOYAGE and 2ndLEG.

Once we have identified the LEG_SEQ_NBR of the VESSEL,VOYAGE, LEG already stored in table1 we need to add '1' to this value and then find that LEQ_SEQ_NBR in table2.

The DDL of table1 and table2 along with the test data are as below:

CREATE TABLE [dbo].[table1](
[BL_ID] [decimal](10, 0) NOT NULL,
[VESSEL] [nvarchar](10) NULL,
[VOYAGE] [nvarchar](12) NULL,
[LEG] [nchar](3) NULL,

[Code] ....

For Example:

BLNO = 21 and BL_ID = 1

Current Vessel/Voyage/Leg in table1 = CEUR 032E E

LEG_SEQ_NBR of this Vessel/Voyage/Leg in table1 = '1'

Therefore if we add '1' to this value we'd be looking for LEG_SEQ_NBR '2' as the 2ndVESSEL,2ndVOYAGE,2ndLEG.

In this case that would = MARB 794S S

How this can be worked out through an SSIS job ?

View 4 Replies View Related

Determine That ID Is Unique In Customer Table

Oct 12, 2014

I would need to rewrite SQL code to determine that id is unique in the Customer table.

My two tables are:

CREATE TABLE CUSTOMER(
[CUSTNO] varchar(5) NOT NULL,
[ID] CHAR(9) NOT NULL,
[NAME] VARCHAR(128) NOT NULL,
[ADDRESS] VARCHAR(128) NOT NULL,
[DATEOFBIRTH] DATE NOT NULL,

[Code] ....

View 2 Replies View Related

How To Determine Length Of Table Row In Sql 2005

Sep 14, 2006

How, other than by doing the addition on my own, can I detemrine the length of a row in a table?



TIA,



barkingdog

View 7 Replies View Related

Determine Current Table Of Trigger

May 6, 2008

Good Morning

Is There anyway to determine the table you are referencing in a trigger's inserted / deleted tables?

i.e would this be possible
print @Table_Name + " was Updated"

Where @Table_Name is the table on which the trigger is created

(bad example I know but you get the idea)

Any input will be appreciated.


View 3 Replies View Related

How To: Determine If A Table Exists Using SQL Or TSQL.

Feb 4, 2008

I need a SQL or TSQL command (not a stored procedure) that will determine if a table exists (TBL_PARAMETERS). The command needs to return a 1 if the table exists or 0 if it dose not exist.

Thanks!
Sean

View 10 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

SQL 2012 :: Determine If A Certain Table Has Been Accessed In The Past?

Nov 4, 2015

code that I can use to determine if a certain table has been accessed in the past?

View 6 Replies View Related

How To Determine Table And Column Names In A Trigger?

May 5, 2008

Hi all,

I'm new to this whole trigger 'thing', so forgive me if this question has been asked and answered a few times already.

I'm in the process of writing a trigger that will send an e-mail to an application admin when any table within a given database is altered (IE, a column is added or deleted). I can get the e-mail to fire off when that happens without any issue, but I'd like to be able to let the admin know which table was tweaked and what new column was added.


Is this a relatively easy thing to do and I'm just not finding the right built-in variable name, or does something more need to be done?

Thanks,
-Mike

View 4 Replies View Related

Transact SQL :: Query To Determine Overlapping Date Ranges (by Category)

May 12, 2015

Given the data below, I have a couple needs:

1) Query to determine if any date ranges overlap (regardless of category, e.g., row ids 6 & 7 below)

2) Query to determine if any date ranges of the same category overlap

declare @t1 table (id int primary key, category int, start_date datetime, end_date datetime)
insert @t1 select 1, 1, '1/1/2015 12:00:00 AM', '1/15/2015 12:59:59 PM'
insert @t1 select 2, 1, '1/16/2015 12:00:00 AM', '1/31/2015 12:59:59 PM'
insert @t1 select 3, 1, '2/1/2015 12:00:00 AM', '2/15/2015 12:59:59 PM'
insert @t1 select 4, 1, '2/16/2015 12:00:00 AM', '2/28/2015 12:59:59 PM'
insert @t1 select 5, 1, '3/1/2015 12:00:00 AM', '3/15/2015 12:59:59 PM'

[code]....

View 7 Replies View Related

Sproc To Determine If Query Will Produce Invalid SqlNotificationEventArgs Event

Feb 7, 2007

I'm using an SqlDependency so I'll get an alert when the data under a query changes. When the query does not meet the criteria spelled out here http://msdn2.microsoft.com/en-us/library/aewzkxxh.aspx then I immediately get a SqlNotificationEventArgs event with the "Invalid" note. This is good.

I would like to know that a query is invalid before I try it with my ASP.NET application. Is there a sproc I can give to my SQL developers so they can test that they haven't used any stuff that would invalidate SqlDependency? What I'm hoping is that there's already a system sproc which could be called...

exec sp_QueryInvalidForNotification "exec myTestSproc 99"

Does such a sproc exist? Or does anyone know how to write one?

View 1 Replies View Related

SP To Determine Layout, Population And Sample Data In Table(s)

Nov 1, 2007

Hi! I am new to SQL Server... looking for some veteran assistance.

"Data Integrity Report"

I need a Stored Procedure that takes a table name as a parameter and returns a cursor suitable as a data source for a pre-built Report Services report (I guess Report Services would call the SP?).

The cursor/report needs to have the following columns:



Ordinal_Position (I.E. Column number)
Column_Name
Number Of Blank Rows (how many missing values for this column in this table)
Difference (Between total rowcount and population of this column)

Data_Type

Column_Length (either Character_Maximum_Length or the numeric widths rolled up with COALESCE?)
Sample Data (The contents of the "first" row in the table, based on a TOP(1) and ORDER BY xxx)
The report should look like this (for a table with 100 rows):

Col Num Col Name # Blanks Difference Data Type Col Length Sample Data
1 Name 12 88 varchar 30 Sally Smith
2 Address 34 66 varchar 45 123 Main St Apt 45
3 Acct_ID 0 100 varchar 4 AB12345

Using the "Information_Schema.Columns" I can get everything I need except for #3 (blanks count) and #7 (Sample data).

Is it possible to do this as 1 query, with a CTE or APPLY or something, or do I need to do a table variable based on the Information_Schema and then use dynamic SQL and row-by-row COUNT(*) for each column? And the same for the Sample Data.

Sorry for the long post, and thanks in advance!
John

View 1 Replies View Related

How To Determine, Inside A Function, If A Linked-server-query Returned Results

Feb 13, 2004

Hi, have configured an ODBC linked server for an Adaptive Server Anywhere (ASA6.0) database.
I have to write a function (not a procedure) that receives a number (@Code) and returns 1 if it was found on a table in the linked server, or 0 if not. Looks very simple...
One problem, is that the queries on a linked-server must be made through the OPENQUERY statement, which doesen't support dynamic parameters. I've solved this making the whole query a string, and executing it, something like this:

SET @SQL='SELECT * FROM OPENQUERY(CAT_ASA, ''SELECT code FROM countries WHERE code=' + @Code + ''')'
EXEC sp_executesql @SQL

(CAT_ASA is the linked-server's name)

Then, i would use @@ROWCOUNT to determine if the code exists or not. But before this, a problem appears: sp_executesql is not allowed within a function (only extended procedures are allowed).
Does somebody know how to make what i want?? I prefer to avoid using temporary tables.
Thanks!

View 3 Replies View Related







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