Showing posts with label hiis. Show all posts
Showing posts with label hiis. Show all posts

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...
> 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...[vbcol=seagreen]
> 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...
given
>
|||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
>
>
sql

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...
> 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...[vbcol=seagreen]
> 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...
given
>
|||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
>
>

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...
> 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...
given[vbcol=seagreen]
>|||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
>
>

Tuesday, March 20, 2012

Number of characters in a "IN" clause

Hi
Is there any limits on how many characters I can have in an "IN" clause
(e.g. select ID from table where Name IN (test, test1....etc..)?
Reason for asking is that I have a statement that fails when I have more
than 500 characters in the "IN" clause, so I was wondering if it's due to
limitations in the IN clause or if it's something else that restrict the
number of characters.
Regards
Steen
Just that the total batch can not be > 64K
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
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:OUAPZ2gLFHA.1948@.TK2MSFTNGP14.phx.gbl...
> Hi
> Is there any limits on how many characters I can have in an "IN" clause
> (e.g. select ID from table where Name IN (test, test1....etc..)?
> Reason for asking is that I have a statement that fails when I have more
> than 500 characters in the "IN" clause, so I was wondering if it's due to
> limitations in the IN clause or if it's something else that restrict the
> number of characters.
> Regards
> Steen
>
|||Thanks Wayne...
In the meantime I actually found out that it isn't SQL as such that holds
the limitation. I tried to add more parameters to the query in QA and here
it works fine. It seems like it's the application that cuts the IN clause to
max. 500 (or 499) characters, so they must have set a limit somewhere. If
there's a reason for that or not is then the question, that I'll have to
discuss with the vendor.
Regards
Steen
Wayne Snyder wrote:[vbcol=seagreen]
> Just that the total batch can not be > 64K
>
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> news:OUAPZ2gLFHA.1948@.TK2MSFTNGP14.phx.gbl...
|||If you mean number of items in the IN clause, then I would not recommend
hundreds of items. After some 500 items, the compilation time grows very
fast, making the query very slow. In those cases, it is better to store
all these items in a table, and use EXISTS or join with the table.
HTH,
Gert-Jan
Steen Persson wrote:
> Hi
> Is there any limits on how many characters I can have in an "IN" clause
> (e.g. select ID from table where Name IN (test, test1....etc..)?
> Reason for asking is that I have a statement that fails when I have more
> than 500 characters in the "IN" clause, so I was wondering if it's due to
> limitations in the IN clause or if it's something else that restrict the
> number of characters.
> Regards
> Steen
|||Hi Gert-Jan
I agree with you, but unfortunately that's the way the application has been
designed by the vendor. It seems like the developers have never thought that
you'd add so many options in the application - and this is not the only
"poor" solution they have programmed...:-(
Regards
Steen
Gert-Jan Strik wrote:[vbcol=seagreen]
> If you mean number of items in the IN clause, then I would not
> recommend hundreds of items. After some 500 items, the compilation
> time grows very fast, making the query very slow. In those cases, it
> is better to store all these items in a table, and use EXISTS or join
> with the table.
> HTH,
> Gert-Jan
>
> Steen Persson wrote:

Number of characters in a "IN" clause

Hi
Is there any limits on how many characters I can have in an "IN" clause
(e.g. select ID from table where Name IN (test, test1....etc..)?
Reason for asking is that I have a statement that fails when I have more
than 500 characters in the "IN" clause, so I was wondering if it's due to
limitations in the IN clause or if it's something else that restrict the
number of characters.
Regards
SteenJust that the total batch can not be > 64K
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
"Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
news:OUAPZ2gLFHA.1948@.TK2MSFTNGP14.phx.gbl...
> Hi
> Is there any limits on how many characters I can have in an "IN" clause
> (e.g. select ID from table where Name IN (test, test1....etc..)?
> Reason for asking is that I have a statement that fails when I have more
> than 500 characters in the "IN" clause, so I was wondering if it's due to
> limitations in the IN clause or if it's something else that restrict the
> number of characters.
> Regards
> Steen
>|||Thanks Wayne...
In the meantime I actually found out that it isn't SQL as such that holds
the limitation. I tried to add more parameters to the query in QA and here
it works fine. It seems like it's the application that cuts the IN clause to
max. 500 (or 499) characters, so they must have set a limit somewhere. If
there's a reason for that or not is then the question, that I'll have to
discuss with the vendor.
Regards
Steen
Wayne Snyder wrote:[vbcol=seagreen]
> Just that the total batch can not be > 64K
>
> "Steen Persson" <SPE@.REMOVEdatea.dk> wrote in message
> news:OUAPZ2gLFHA.1948@.TK2MSFTNGP14.phx.gbl...|||If you mean number of items in the IN clause, then I would not recommend
hundreds of items. After some 500 items, the compilation time grows very
fast, making the query very slow. In those cases, it is better to store
all these items in a table, and use EXISTS or join with the table.
HTH,
Gert-Jan
Steen Persson wrote:
> Hi
> Is there any limits on how many characters I can have in an "IN" clause
> (e.g. select ID from table where Name IN (test, test1....etc..)?
> Reason for asking is that I have a statement that fails when I have more
> than 500 characters in the "IN" clause, so I was wondering if it's due to
> limitations in the IN clause or if it's something else that restrict the
> number of characters.
> Regards
> Steen|||Hi Gert-Jan
I agree with you, but unfortunately that's the way the application has been
designed by the vendor. It seems like the developers have never thought that
you'd add so many options in the application - and this is not the only
"poor" solution they have programmed...:-(
Regards
Steen
Gert-Jan Strik wrote:[vbcol=seagreen]
> If you mean number of items in the IN clause, then I would not
> recommend hundreds of items. After some 500 items, the compilation
> time grows very fast, making the query very slow. In those cases, it
> is better to store all these items in a table, and use EXISTS or join
> with the table.
> HTH,
> Gert-Jan
>
> Steen Persson wrote: