Link to home
Start Free TrialLog in
Avatar of sg05121983
sg05121983

asked on

Need help on sql query-sharepoint content db

Hi All,

We need to fetch site collections from sharepoint content DB. We have prepared query to fetch the data as per our requirement (Please find the attached script).

But the query is returining sub site too, we don't want sub site in the output report.

Ex:
sites/SS-test  - > is enough
sites/SS-test /Subsite 1   - is not required
sites/SS-test / Subsite 1/Subsite 11  - is not required
sites/SS-test  /Sub site 2 - is not required

Please advise\modify the attached script as per above requirement.

Thanks in advance.
Site-collection-script.txt
Avatar of QPR
QPR
Flag of New Zealand image

If you only want the top level sites for a site collection then you need to specify
WHERE webs.ParentWebId is null
Avatar of sg05121983
sg05121983

ASKER

I have tried with your option, still the output is shwoing subsites.

any other suggestions?
ASKER CERTIFIED SOLUTION
Avatar of QPR
QPR
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
--