Showing posts with label size. Show all posts
Showing posts with label size. Show all posts

Friday, March 30, 2012

How to make Update relation?

I have two tables: TableX & TableY

there is two similar fields (Size) with the same datatype, I want to make a relation in a way if I change the value in (TableX.Size) the same value will be applied to (TableY.Size).

How to?

Lewe:

The are a couple of things that you need to know first:

How does TableX relate to TableY? TableX SHOULD have a key to TableY so that corresponding X and Y members can be joined|||

I'm not sure that you are really talking about needing a 'relation'. It sounds as though you only want a method that will change TableY values when a similar value in TableX is changed.

That 'could' be done with a TRIGGER. But first, it will be necessary for you to identify which row in TableY is to be changed as a result of a particular row in TableX getting changed. In other words, "How do the two tables 'relate' to each other?"

How to make Update relation?

I have two tables: TableX & TableY

there is two similar fields (Size) with the same datatype, I want to make a relation in a way if I change the value in (TableX.Size) the same value will be applied to (TableY.Size).

How to?

Lewe:

The are a couple of things that you need to know first:

How does TableX relate to TableY? TableX SHOULD have a key to TableY so that corresponding X and Y members can be joined|||

I'm not sure that you are really talking about needing a 'relation'. It sounds as though you only want a method that will change TableY values when a similar value in TableX is changed.

That 'could' be done with a TRIGGER. But first, it will be necessary for you to identify which row in TableY is to be changed as a result of a particular row in TableX getting changed. In other words, "How do the two tables 'relate' to each other?"

how to make the database size smaller?

my database is 9G! I try to truncate some table to make the database smaller
but it seems it doesn't help, the database size has not changed by truncate
some table, so is there any good method to make the database size smaller? (I
accept some data loss in some table)!!
Are you backing up this database?
I would run a transaction log backup and truncate the log when you do.
After that you should be able to shrink the database and remove unused space.
~lb
"kei" wrote:

> my database is 9G! I try to truncate some table to make the database smaller
> but it seems it doesn't help, the database size has not changed by truncate
> some table, so is there any good method to make the database size smaller? (I
> accept some data loss in some table)!!
|||how to truncate the log?
anyway, the data file type is already 9G.
"lonnye" wrote:
[vbcol=seagreen]
> Are you backing up this database?
> I would run a transaction log backup and truncate the log when you do.
> After that you should be able to shrink the database and remove unused space.
> --
> ~lb
>
> "kei" wrote:
|||I would look at Books Online for more info - check backup log...
Run this code if you want to truncate the transaction log and not keep a
backup of the transaction log. Truncate_only invalidates your transaction log
backup sequence. Take a full backup of your database after you perform backup
log with truncate_only:
BACKUP LOG YOURDATABASE WITH TRUNCATE_ONLY
~lb
"kei" wrote:
[vbcol=seagreen]
> how to truncate the log?
> anyway, the data file type is already 9G.
>
> "lonnye" wrote:

how to make the database size smaller?

my database is 9G! I try to truncate some table to make the database smaller
but it seems it doesn't help, the database size has not changed by truncate
some table, so is there any good method to make the database size smaller? (I
accept some data loss in some table)!!Are you backing up this database?
I would run a transaction log backup and truncate the log when you do.
After that you should be able to shrink the database and remove unused space.
--
~lb
"kei" wrote:
> my database is 9G! I try to truncate some table to make the database smaller
> but it seems it doesn't help, the database size has not changed by truncate
> some table, so is there any good method to make the database size smaller? (I
> accept some data loss in some table)!!|||how to truncate the log?
anyway, the data file type is already 9G.
"lonnye" wrote:
> Are you backing up this database?
> I would run a transaction log backup and truncate the log when you do.
> After that you should be able to shrink the database and remove unused space.
> --
> ~lb
>
> "kei" wrote:
> > my database is 9G! I try to truncate some table to make the database smaller
> > but it seems it doesn't help, the database size has not changed by truncate
> > some table, so is there any good method to make the database size smaller? (I
> > accept some data loss in some table)!!|||I would look at Books Online for more info - check backup log...
Run this code if you want to truncate the transaction log and not keep a
backup of the transaction log. Truncate_only invalidates your transaction log
backup sequence. Take a full backup of your database after you perform backup
log with truncate_only:
BACKUP LOG YOURDATABASE WITH TRUNCATE_ONLY
--
~lb
"kei" wrote:
> how to truncate the log?
> anyway, the data file type is already 9G.
>
> "lonnye" wrote:
> > Are you backing up this database?
> > I would run a transaction log backup and truncate the log when you do.
> > After that you should be able to shrink the database and remove unused space.
> > --
> > ~lb
> >
> >
> > "kei" wrote:
> >
> > > my database is 9G! I try to truncate some table to make the database smaller
> > > but it seems it doesn't help, the database size has not changed by truncate
> > > some table, so is there any good method to make the database size smaller? (I
> > > accept some data loss in some table)!!|||I suggest you read about the DBCC SHRINKFILE command.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"kei" <kei@.discussions.microsoft.com> wrote in message
news:91BDB5F4-7273-4435-BF3F-4DCB16A66C8F@.microsoft.com...
> my database is 9G! I try to truncate some table to make the database smaller
> but it seems it doesn't help, the database size has not changed by truncate
> some table, so is there any good method to make the database size smaller? (I
> accept some data loss in some table)!!

Friday, March 23, 2012

How to make a smaller size database from a huge size database

Could anyone teach me how make a smaller size of database out of a huge size database? The smaller sized DB should have exactly the same schema as the big size one. THanks in advance and your help is highly appreciated.
Kuilian
Kuilian,
you could replicate all the tables and use horizontal filters to restrict
the number of rows.
HTH,
Paul Ibison
|||Thanks, Paul! If I want to get a smaller size database based on some criteria, how can I pass those criterias? --kuilian
"Paul Ibison" wrote:

> Kuilian,
> you could replicate all the tables and use horizontal filters to restrict
> the number of rows.
> HTH,
> Paul Ibison
>
>
|||KT,
the filter rows tab on the publication properties will allow you to enter
your criteria.
HTH,
Paul Ibison

Monday, March 12, 2012

How to list all tables ordered by their size within a SQL Server 2005 database?

Hi, all,

Would please any expert here give me any guidance and advices for how to list all tables sorted by their size within a SQL Server 2005 database?

Thanks a lot in advance for that.

With best regards,

Yours sincerely,

Hi,

A similar kind of query I've seen on a site. In the example given by the author of the query, he usedDynamic Management Views. You can find the original query from here http://www.extremeexperts.com/SQL/Scripts/FindSizeOfTable.aspx

As per your requirement, I have made some changes to the query. Here it is

WITH table_space_usage ( schema_name, table_name, used, reserved, ind_rows, tbl_rows )
AS(SELECT
s.Name
, o.Name
, p.used_page_count * 8
, p.reserved_page_count * 8
, p.row_count
,casewhen i.index_id in( 0, 1 )then p.row_count else 0 end
FROMsys.dm_db_partition_stats p
INNERJOINsys.objectsas o ON o.object_id= p.object_id
INNERJOINsys.schemasas s ON s.schema_id = o.schema_id
LEFTOUTERJOINsys.indexesas i on i.object_id= p.object_idand i.index_id = p.index_id
WHERE o.type_desc ='USER_TABLE' and o.is_ms_shipped = 0)

SELECT t.schema_name
, t.table_name
,sum(t.used)as used_in_kb
,sum(t.reserved)as reserved_in_kb
,sum(t.tbl_rows)as rows

FROM table_space_usage as t

GROUPBY t.schema_name , t.table_name

ORDERBY used_in_kb desc

Hope it will help you

|||

Hi, Neeraj,

Thanks a lot for your very helpful guidance.

With best regards,

Yours sincerely,

How to list all tables and their size

Is there a stored procedure to list all tables and their size, and / or
number of rows
Is there a stored procedure to list all indexes and their size
Check this link:
How do I get a list of SQL Server tables and their row counts?
http://sqlserver2000.databases.aspfaq.com/how-do-i-get-a-list-of-sql-server-tables-and-their-row-counts.html
"Zack" wrote:

> Is there a stored procedure to list all tables and their size, and / or
> number of rows
> Is there a stored procedure to list all indexes and their size
>
>

How to list all tables and their size

Is there a stored procedure to list all tables and their size, and / or
number of rows
Is there a stored procedure to list all indexes and their sizeCheck this link:
How do I get a list of SQL Server tables and their row counts?
http://sqlserver2000.databases.aspf...row-counts.html
"Zack" wrote:

> Is there a stored procedure to list all tables and their size, and / or
> number of rows
> Is there a stored procedure to list all indexes and their size
>
>|||The final solution in that article uses DBCC UPDATEUSAGE(0). This is fine,
but here are two further suggestions you might want to take into
consideration:
a) DBCC UPDATEUSAGE(0) updates sysindexes for all indexes on all tables in a
database. This can take a long time on a large production database & lead to
major performance degradation if used during peak processing periods. Just
make sure you schedule this for periods of low activity or keep a close eye
on the server whilst its running if users are using the database at the
time.
b) DBCC UPDATEUSAGE(0) alone doesn't update the rowcount for each table -
you have to add the additional "with count_rows" option if you want an
update of how many rows are in the table. Keep in mind that this figure will
always be slightly out of date on a busy server thoug. I generally don't use
it, but it's worth knowing all the same
Regards,
Greg Linwood
SQL Server MVP
http://blogs.sqlserver.org.au/blogs/greg_linwood
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA"
< EdgardoValdezMCTSMCITPMCSDMCDBA@.discussi
ons.microsoft.com> wrote in message
news:57C92A87-D9DE-46AE-A45C-39D1DF9A272E@.microsoft.com...[vbcol=seagreen]
> Check this link:
> How do I get a list of SQL Server tables and their row counts?
> http://sqlserver2000.databases.aspf...row-counts.html
> "Zack" wrote:
>

How to list all tables and their size

Is there a stored procedure to list all tables and their size, and / or
number of rows
Is there a stored procedure to list all indexes and their sizeCheck this link:
How do I get a list of SQL Server tables and their row counts?
http://sqlserver2000.databases.aspfaq.com/how-do-i-get-a-list-of-sql-server-tables-and-their-row-counts.html
"Zack" wrote:
> Is there a stored procedure to list all tables and their size, and / or
> number of rows
> Is there a stored procedure to list all indexes and their size
>
>|||The final solution in that article uses DBCC UPDATEUSAGE(0). This is fine,
but here are two further suggestions you might want to take into
consideration:
a) DBCC UPDATEUSAGE(0) updates sysindexes for all indexes on all tables in a
database. This can take a long time on a large production database & lead to
major performance degradation if used during peak processing periods. Just
make sure you schedule this for periods of low activity or keep a close eye
on the server whilst its running if users are using the database at the
time.
b) DBCC UPDATEUSAGE(0) alone doesn't update the rowcount for each table -
you have to add the additional "with count_rows" option if you want an
update of how many rows are in the table. Keep in mind that this figure will
always be slightly out of date on a busy server thoug. I generally don't use
it, but it's worth knowing all the same
Regards,
Greg Linwood
SQL Server MVP
http://blogs.sqlserver.org.au/blogs/greg_linwood
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA"
<EdgardoValdezMCTSMCITPMCSDMCDBA@.discussions.microsoft.com> wrote in message
news:57C92A87-D9DE-46AE-A45C-39D1DF9A272E@.microsoft.com...
> Check this link:
> How do I get a list of SQL Server tables and their row counts?
> http://sqlserver2000.databases.aspfaq.com/how-do-i-get-a-list-of-sql-server-tables-and-their-row-counts.html
> "Zack" wrote:
>> Is there a stored procedure to list all tables and their size, and / or
>> number of rows
>> Is there a stored procedure to list all indexes and their size
>>

Friday, February 24, 2012

How to know what is filling UpTempdb

Hi all,
I have a question regarding my TempDB,The initial size of
my tempdb was 10MB and it has grown to 250mb in a have day
and then i wanted to test my vb application a simple
stored proc couldn't return a resultset and errored out
saying Query Timed Out ,Then i tried to increse the size
of Tempdb to 1000MB ,now the query runs fine but i want to
know what is filling the tempdb space and how to clean up
without restarting the sql server.
Thanks
Sudhahttp://www.aspfaq.com/2446
http://www.aspfaq.com/
(Reverse address to reply.)
"Sudha Reddy" <anonymous@.discussions.microsoft.com> wrote in message
news:17fe301c4499d$54e7b160$a001280a@.phx
.gbl...
> Hi all,
> I have a question regarding my TempDB,The initial size of
> my tempdb was 10MB and it has grown to 250mb in a have day
> and then i wanted to test my vb application a simple
> stored proc couldn't return a resultset and errored out
> saying Query Timed Out ,Then i tried to increse the size
> of Tempdb to 1000MB ,now the query runs fine but i want to
> know what is filling the tempdb space and how to clean up
> without restarting the sql server.
> Thanks
> Sudha|||Thanks for the link it helps
>--Original Message--
>http://www.aspfaq.com/2446
>--
>http://www.aspfaq.com/
>(Reverse address to reply.)
>
>
>"Sudha Reddy" <anonymous@.discussions.microsoft.com> wrote
in message
> news:17fe301c4499d$54e7b160$a001280a@.phx
.gbl...
of[vbcol=seagreen]
day[vbcol=seagreen]
to[vbcol=seagreen]
up[vbcol=seagreen]
>
>.
>

How to know what is filling UpTempdb

Hi all,
I have a question regarding my TempDB,The initial size of
my tempdb was 10MB and it has grown to 250mb in a have day
and then i wanted to test my vb application a simple
stored proc couldn't return a resultset and errored out
saying Query Timed Out ,Then i tried to increse the size
of Tempdb to 1000MB ,now the query runs fine but i want to
know what is filling the tempdb space and how to clean up
without restarting the sql server.
Thanks
Sudhahttp://www.aspfaq.com/2446
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Sudha Reddy" <anonymous@.discussions.microsoft.com> wrote in message
news:17fe301c4499d$54e7b160$a001280a@.phx.gbl...
> Hi all,
> I have a question regarding my TempDB,The initial size of
> my tempdb was 10MB and it has grown to 250mb in a have day
> and then i wanted to test my vb application a simple
> stored proc couldn't return a resultset and errored out
> saying Query Timed Out ,Then i tried to increse the size
> of Tempdb to 1000MB ,now the query runs fine but i want to
> know what is filling the tempdb space and how to clean up
> without restarting the sql server.
> Thanks
> Sudha|||Thanks for the link it helps
>--Original Message--
>http://www.aspfaq.com/2446
>--
>http://www.aspfaq.com/
>(Reverse address to reply.)
>
>
>"Sudha Reddy" <anonymous@.discussions.microsoft.com> wrote
in message
>news:17fe301c4499d$54e7b160$a001280a@.phx.gbl...
>> Hi all,
>> I have a question regarding my TempDB,The initial size
of
>> my tempdb was 10MB and it has grown to 250mb in a have
day
>> and then i wanted to test my vb application a simple
>> stored proc couldn't return a resultset and errored out
>> saying Query Timed Out ,Then i tried to increse the size
>> of Tempdb to 1000MB ,now the query runs fine but i want
to
>> know what is filling the tempdb space and how to clean
up
>> without restarting the sql server.
>> Thanks
>> Sudha
>
>.
>

How to know what is filling UpTempdb

Hi all,
I have a question regarding my TempDB,The initial size of
my tempdb was 10MB and it has grown to 250mb in a have day
and then i wanted to test my vb application a simple
stored proc couldn't return a resultset and errored out
saying Query Timed Out ,Then i tried to increse the size
of Tempdb to 1000MB ,now the query runs fine but i want to
know what is filling the tempdb space and how to clean up
without restarting the sql server.
Thanks
Sudha
http://www.aspfaq.com/2446
http://www.aspfaq.com/
(Reverse address to reply.)
"Sudha Reddy" <anonymous@.discussions.microsoft.com> wrote in message
news:17fe301c4499d$54e7b160$a001280a@.phx.gbl...
> Hi all,
> I have a question regarding my TempDB,The initial size of
> my tempdb was 10MB and it has grown to 250mb in a have day
> and then i wanted to test my vb application a simple
> stored proc couldn't return a resultset and errored out
> saying Query Timed Out ,Then i tried to increse the size
> of Tempdb to 1000MB ,now the query runs fine but i want to
> know what is filling the tempdb space and how to clean up
> without restarting the sql server.
> Thanks
> Sudha
|||Thanks for the link it helps
>--Original Message--
>http://www.aspfaq.com/2446
>--
>http://www.aspfaq.com/
>(Reverse address to reply.)
>
>
>"Sudha Reddy" <anonymous@.discussions.microsoft.com> wrote
in message[vbcol=seagreen]
>news:17fe301c4499d$54e7b160$a001280a@.phx.gbl...
of[vbcol=seagreen]
day[vbcol=seagreen]
to[vbcol=seagreen]
up
>
>.
>

How to know the table size in sql database and how to know which table has updated

Hi,
May i check with you, how to know the size of the table in the database. If
someone has updated one data into one table, how to know, which table has
updated at the database?
Thanks.
regards,
florenceHi,
To get the space used:-
SP_spaceused <table_name>
Enable the profiler to identify the updates happened.
Thanks
Hari
SQL Server MVP
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:OYkrcy$vEHA.612@.TK2MSFTNGP15.phx.gbl...
> Hi,
> May i check with you, how to know the size of the table in the database.
> If
> someone has updated one data into one table, how to know, which table has
> updated at the database?
> Thanks.
> regards,
> florence
>|||Hi,
Thanks for your reply..another question, what if i want to know which
table has the biggest size?
Thanks.
regards,
florence
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:#IDW43$vEHA.2192@.TK2MSFTNGP14.phx.gbl...
> Hi,
> To get the space used:-
> SP_spaceused <table_name>
> Enable the profiler to identify the updates happened.
>
> --
> Thanks
> Hari
> SQL Server MVP
>
> "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> news:OYkrcy$vEHA.612@.TK2MSFTNGP15.phx.gbl...
> > Hi,
> >
> > May i check with you, how to know the size of the table in the database.
> > If
> > someone has updated one data into one table, how to know, which table
has
> > updated at the database?
> >
> > Thanks.
> >
> > regards,
> > florence
> >
> >
>|||Hi
Probably a best method will be to run with cursor thru each table and
perform select count(*) from table and then compare which one has a big
output
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:OufvGNAwEHA.3320@.TK2MSFTNGP14.phx.gbl...
> Hi,
> Thanks for your reply..another question, what if i want to know which
> table has the biggest size?
> Thanks.
> regards,
> florence
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:#IDW43$vEHA.2192@.TK2MSFTNGP14.phx.gbl...
> > Hi,
> >
> > To get the space used:-
> >
> > SP_spaceused <table_name>
> >
> > Enable the profiler to identify the updates happened.
> >
> >
> > --
> > Thanks
> > Hari
> > SQL Server MVP
> >
> >
> > "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> > news:OYkrcy$vEHA.612@.TK2MSFTNGP15.phx.gbl...
> > > Hi,
> > >
> > > May i check with you, how to know the size of the table in the
database.
> > > If
> > > someone has updated one data into one table, how to know, which table
> has
> > > updated at the database?
> > >
> > > Thanks.
> > >
> > > regards,
> > > florence
> > >
> > >
> >
> >
>|||YOu may also want to write a query directly agains sysindexes... If I
remember correctly, dpages, ipages, and reserved..You might want to take a
look at sp_spaceused and steal som code from there to come up with your
own... or search the web ( maybe www.sqlservercentral.com) probably has a
script you can use..
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uBkRydAwEHA.1976@.TK2MSFTNGP09.phx.gbl...
> Hi
> Probably a best method will be to run with cursor thru each table and
> perform select count(*) from table and then compare which one has a big
> output
>
>
> "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> news:OufvGNAwEHA.3320@.TK2MSFTNGP14.phx.gbl...
> > Hi,
> > Thanks for your reply..another question, what if i want to know
which
> > table has the biggest size?
> >
> > Thanks.
> > regards,
> >
> > florence
> >
> > "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> > news:#IDW43$vEHA.2192@.TK2MSFTNGP14.phx.gbl...
> > > Hi,
> > >
> > > To get the space used:-
> > >
> > > SP_spaceused <table_name>
> > >
> > > Enable the profiler to identify the updates happened.
> > >
> > >
> > > --
> > > Thanks
> > > Hari
> > > SQL Server MVP
> > >
> > >
> > > "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> > > news:OYkrcy$vEHA.612@.TK2MSFTNGP15.phx.gbl...
> > > > Hi,
> > > >
> > > > May i check with you, how to know the size of the table in the
> database.
> > > > If
> > > > someone has updated one data into one table, how to know, which
table
> > has
> > > > updated at the database?
> > > >
> > > > Thanks.
> > > >
> > > > regards,
> > > > florence
> > > >
> > > >
> > >
> > >
> >
> >
>|||this will do the trick:
sp_MSforeachtable @.command1="print '?' Exec sp_mstablespace '?'"
What is happening here is that '?' is like a variable containing the name of
each table during the iteration that happens within the stored procedure.
Therefore, you will have the table name as output and the size of it.
--
Sasan Saidi, MSc in CS
Senior DBA
Brascan Business Services
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Wayne Snyder" wrote:
> YOu may also want to write a query directly agains sysindexes... If I
> remember correctly, dpages, ipages, and reserved..You might want to take a
> look at sp_spaceused and steal som code from there to come up with your
> own... or search the web ( maybe www.sqlservercentral.com) probably has a
> script you can use..
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uBkRydAwEHA.1976@.TK2MSFTNGP09.phx.gbl...
> > Hi
> > Probably a best method will be to run with cursor thru each table and
> > perform select count(*) from table and then compare which one has a big
> > output
> >
> >
> >
> >
> >
> > "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> > news:OufvGNAwEHA.3320@.TK2MSFTNGP14.phx.gbl...
> > > Hi,
> > > Thanks for your reply..another question, what if i want to know
> which
> > > table has the biggest size?
> > >
> > > Thanks.
> > > regards,
> > >
> > > florence
> > >
> > > "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> > > news:#IDW43$vEHA.2192@.TK2MSFTNGP14.phx.gbl...
> > > > Hi,
> > > >
> > > > To get the space used:-
> > > >
> > > > SP_spaceused <table_name>
> > > >
> > > > Enable the profiler to identify the updates happened.
> > > >
> > > >
> > > > --
> > > > Thanks
> > > > Hari
> > > > SQL Server MVP
> > > >
> > > >
> > > > "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> > > > news:OYkrcy$vEHA.612@.TK2MSFTNGP15.phx.gbl...
> > > > > Hi,
> > > > >
> > > > > May i check with you, how to know the size of the table in the
> > database.
> > > > > If
> > > > > someone has updated one data into one table, how to know, which
> table
> > > has
> > > > > updated at the database?
> > > > >
> > > > > Thanks.
> > > > >
> > > > > regards,
> > > > > florence
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

How to know the table size in sql database and how to know which table has updated

Hi,
May i check with you, how to know the size of the table in the database. If
someone has updated one data into one table, how to know, which table has
updated at the database?
Thanks.
regards,
florenceHi,
To get the space used:-
SP_spaceused <table_name>
Enable the profiler to identify the updates happened.
Thanks
Hari
SQL Server MVP
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:OYkrcy$vEHA.612@.TK2MSFTNGP15.phx.gbl...
> Hi,
> May i check with you, how to know the size of the table in the database.
> If
> someone has updated one data into one table, how to know, which table has
> updated at the database?
> Thanks.
> regards,
> florence
>|||Hi,
Thanks for your reply..another question, what if i want to know which
table has the biggest size?
Thanks.
regards,
florence
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:#IDW43$vEHA.2192@.TK2MSFTNGP14.phx.gbl...
> Hi,
> To get the space used:-
> SP_spaceused <table_name>
> Enable the profiler to identify the updates happened.
>
> --
> Thanks
> Hari
> SQL Server MVP
>
> "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> news:OYkrcy$vEHA.612@.TK2MSFTNGP15.phx.gbl...
has[vbcol=seagreen]
>|||Hi
Probably a best method will be to run with cursor thru each table and
perform select count(*) from table and then compare which one has a big
output
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:OufvGNAwEHA.3320@.TK2MSFTNGP14.phx.gbl...
> Hi,
> Thanks for your reply..another question, what if i want to know which
> table has the biggest size?
> Thanks.
> regards,
> florence
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:#IDW43$vEHA.2192@.TK2MSFTNGP14.phx.gbl...
database.[vbcol=seagreen]
> has
>|||YOu may also want to write a query directly agains sysindexes... If I
remember correctly, dpages, ipages, and reserved..You might want to take a
look at sp_spaceused and steal som code from there to come up with your
own... or search the web ( maybe www.sqlservercentral.com) probably has a
script you can use..
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uBkRydAwEHA.1976@.TK2MSFTNGP09.phx.gbl...
> Hi
> Probably a best method will be to run with cursor thru each table and
> perform select count(*) from table and then compare which one has a big
> output
>
>
> "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> news:OufvGNAwEHA.3320@.TK2MSFTNGP14.phx.gbl...
which[vbcol=seagreen]
> database.
table[vbcol=seagreen]
>

How to know the table size in sql database and how to know which table has updated

Hi,
May i check with you, how to know the size of the table in the database. If
someone has updated one data into one table, how to know, which table has
updated at the database?
Thanks.
regards,
florence
Hi,
To get the space used:-
SP_spaceused <table_name>
Enable the profiler to identify the updates happened.
Thanks
Hari
SQL Server MVP
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:OYkrcy$vEHA.612@.TK2MSFTNGP15.phx.gbl...
> Hi,
> May i check with you, how to know the size of the table in the database.
> If
> someone has updated one data into one table, how to know, which table has
> updated at the database?
> Thanks.
> regards,
> florence
>
|||Hi,
Thanks for your reply..another question, what if i want to know which
table has the biggest size?
Thanks.
regards,
florence
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:#IDW43$vEHA.2192@.TK2MSFTNGP14.phx.gbl...[vbcol=seagreen]
> Hi,
> To get the space used:-
> SP_spaceused <table_name>
> Enable the profiler to identify the updates happened.
>
> --
> Thanks
> Hari
> SQL Server MVP
>
> "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> news:OYkrcy$vEHA.612@.TK2MSFTNGP15.phx.gbl...
has
>
|||Hi
Probably a best method will be to run with cursor thru each table and
perform select count(*) from table and then compare which one has a big
output
"Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
news:OufvGNAwEHA.3320@.TK2MSFTNGP14.phx.gbl...[vbcol=seagreen]
> Hi,
> Thanks for your reply..another question, what if i want to know which
> table has the biggest size?
> Thanks.
> regards,
> florence
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:#IDW43$vEHA.2192@.TK2MSFTNGP14.phx.gbl...
database.
> has
>
|||YOu may also want to write a query directly agains sysindexes... If I
remember correctly, dpages, ipages, and reserved..You might want to take a
look at sp_spaceused and steal som code from there to come up with your
own... or search the web ( maybe www.sqlservercentral.com) probably has a
script you can use..
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uBkRydAwEHA.1976@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Hi
> Probably a best method will be to run with cursor thru each table and
> perform select count(*) from table and then compare which one has a big
> output
>
>
> "Florencelee" <florencelee@.visualsolutions.com.my> wrote in message
> news:OufvGNAwEHA.3320@.TK2MSFTNGP14.phx.gbl...
which[vbcol=seagreen]
> database.
table
>