Friday, March 23, 2012

number of rows in catalog

Hi
Is there a system query that will tell me the number of rows in a given
catalog?
Cheers
James> Is there a system query that will tell me the number of rows in a given
> catalog?
Here is an easy way:
EXEC sp_MSforeachtable 'sp_spaceused ''?'', ''true'''
--
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com|||This will return a good estimate of the number of rows in each table:
SELECT A.name, B.rows
FROM sysobjects A
JOIN sysindexes B ON A.ID = B.ID
WHERE A.type = 'U'
AND B.INDID < 2
ORDER BY A.Name
It is important to know that this is an estimate. The numbers are usually
pretty close. If you find that they are off you may have to issue several
DBCC statements (such as updateusage).
--
Keith
"James Brett" <james.brett@.unified.co.uk> wrote in message
news:%23mC3OeQsEHA.3460@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a system query that will tell me the number of rows in a given
> catalog?
> Cheers
> James
>|||I was actually after the number of rows in the full text index catalog.
Any clues?
Cheers
James
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:%23hU7YjRsEHA.1248@.TK2MSFTNGP10.phx.gbl...
> > Is there a system query that will tell me the number of rows in a given
> > catalog?
> Here is an easy way:
> EXEC sp_MSforeachtable 'sp_spaceused ''?'', ''true'''
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> Solid Quality Learning
> More than just Training
> www.SolidQualityLearning.com
>
>|||to get an accurate number for each table you would
select count(*) from table
For an estimate you might
select name, rowcnt from sysindexes where id > 100 and indid in (0,1)
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
"James Brett" <james.brett@.unified.co.uk> wrote in message
news:%23mC3OeQsEHA.3460@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a system query that will tell me the number of rows in a given
> catalog?
> Cheers
> James
>|||catalogs don't contain words per se, but rather unique words. Use this
query to get an idea of the number of unique words
select FulltextCatalogProperty('CatalogName', 'UniqueKeyCount')
--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"James Brett" <james.brett@.unified.co.uk> wrote in message
news:eqFnnxRsEHA.1988@.TK2MSFTNGP11.phx.gbl...
> I was actually after the number of rows in the full text index catalog.
> Any clues?
> Cheers
> James
> "Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
> message news:%23hU7YjRsEHA.1248@.TK2MSFTNGP10.phx.gbl...
> > > Is there a system query that will tell me the number of rows in a
given
> > > catalog?
> >
> > Here is an easy way:
> > EXEC sp_MSforeachtable 'sp_spaceused ''?'', ''true'''
> >
> > --
> > Dejan Sarka, SQL Server MVP
> > Associate Mentor
> > Solid Quality Learning
> > More than just Training
> > www.SolidQualityLearning.com
> >
> >
> >
> >
>|||James,
You can use the following metadata Full Text Search (FTS) queries to obtain
info from the FT Catalog:
select FulltextCatalogProperty('<FT_Catalog>', 'UniqueKeyCount') -- Number
of unique words
select FullTextCatalogProperty('<FT_Catalog>', 'itemcount') -- row count + 1
select FullTextCatalogProperty('<FT_Catalog>', 'indexsize') -- Size of the
full-text index
See BOL title FULLTEXTCATALOGPROPERTY for more info.
Thanks,
John
"James Brett" <james.brett@.unified.co.uk> wrote in message
news:#mC3OeQsEHA.3460@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a system query that will tell me the number of rows in a given
> catalog?
> Cheers
> James
>|||Hi James,
I think this will get you what you want ...
select FulltextCatalogProperty('CatalogName', 'ItemCount')
"James Brett" wrote:
> Hi
> Is there a system query that will tell me the number of rows in a given
> catalog?
> Cheers
> James
>
>

No comments:

Post a Comment