Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

How Many Documents in a Web Application

  Asked By: Nakul    Date: Feb 15    Category: Sharepoint    Views: 838

Is there a way to determine how many .doc or .xls etc files there are
in the entire web application? It looks like you should be able to
query dbo.AllDocs, but I wasn't sure of the syntax. I'd like to do
something like:

FROM AllDocs
WHERE Leafname ends in .xls

I don't think 'ends in .xls' is a valid sql syntax though



4 Answers Found

Answer #1    Answered By: Johathan Mcgowan     Answered On: Feb 15

WHERE (LeafName LIKE '%.doc')
works. just change .doc to whatever interested in.

Now the question is, am i counting what i think i am?

Answer #2    Answered By: Georgia Barr     Answered On: Feb 15

Querying the database directly is highly discouraged. Have you looked
at using the search APIs under the context of the indexer account?

Answer #3    Answered By: Jessi Sweet     Answered On: Feb 15

That might be a better idea, except search seems to be pretty flakey.
For instance, I have one web  application that search seems to be
working, but doesn't return any ms office type docs (doc, xls) in a
handful of libraries. Crawl log shows errors of:
The object was not found. (The item was deleted because it was either
not found or the crawler was denied access to it.) However, doc  and
xls files  are crawled elsewhere in the web application. Couple that
with the fact that the site is an import and not indexed yet, and it
just seemed logical to query the db directly trying to get an accurate
count of documents  that are there. Changes to the db directly, never.
What's the issue with queries though?

Answer #4    Answered By: Kelvin Mckinney     Answered On: Feb 15

Querying the database is not an operation supported by Microsoft.

Here is a quick list of reasons from the hip:
-Unpublished database schema
-Unanticipated locking issues
-Unanticipated caching issues
-Unanticipated contention for database resources issues
-SP and release alterations to the data store schema are commonplace
-SP and release alterations to the semantics of the schema are
-Minor nuances in the semantic meaning of data storage lead to divergent
results when compared with results from API
-Denormalization in the data store for query efficiency and data
flexibility make queries complex and if not written correctly,

This list just scratches the surface, but the bottom line is - if it is
discovered that you are querying the database directly when calling for
WSS support, Microsoft will be happy to send you an MCS consultant but
they will not help you via standard support channels. If you are writing
a third party product, Microsoft will denounce your solution if it fails
to adhere to the strict rule: Access the data in the database only via
the prescriptive API or else...

Didn't find what you were looking for? Find more on How Many Documents in a Web Application Or get search suggestion and latest updates.