Re: Get a list of all top level WSS sites in SPS?



Dan,

I've given demos to people that scoff at doing simple queries against the database. In the demo I have some code that does basic queries (just simple SELECT statements) and then I launch two web browsers to hit a SharePoint list. The system (my VMs) lock up and put SharePoint and SQL Server into a deadlock situation. Grant you, I'm doing it in a very controlled manner, but it can happen.

Also from a pure application development perspective, just treat the SharePoint object model as the database. It's your contract to the services they provide (and will support). In .NET there are ways (through reflection) you can expose private member variables to the outside world, however someone somewhere made the decision to make them private for reasons of say simple encapsulation.

Just because you can do something another way, doesn't mean you shouldn't.

Of course, it's your choice and no, fire and brimstone will not fall from the heavens if you take the route you want to take. It's just a matter of being a good SharePoint citizen and following the rules, even if you don't like them.

--
Bil Simser
SharePoint MVP, BSc., MCSD
Calgary, Alberta
http://weblogs.asp.net/bsimser



"Dan Marth" <danmarth@xxxxxxxxxxxxx> wrote in message news:OAiryuRaGHA.5108@xxxxxxxxxxxxxxxxxxxx:

I hear this "don't talk directly to the db" stuff all the time and just had
to reply. Can you give one reason why someone shouldn't do a simple query
against the database, other than, MS might change the field names or MS
doesn't recommend it? I know up front that the field names might change and
am willing to accept that. As far as MS not recommend it, I have done a lot
of things over the years they don't recommend, unless there is a solid
reason for them *not* recommending it.

I have never heard a *solid* reason for not doing a simple query on the db,
I also never heard of a SQL database breaking because someone queried it. I
am just really tired of hearing this stuff about the db, without any good
reason not to do it. If you have any proof that doing a query on the
SharePoint db will bring down SharePoint or corrupt the database, I am all
ears, but I have *never* see anything like that from MS. IMHO, the only
reason they don't recommend talking directly to the db is because field
names might change *not* because it will break anything or decrease
performance.

Dan

"Bil Simser [SPS MVP]" <bsimser@xxxxxxx> wrote in message
news:%23sEb5TNaGHA.504@xxxxxxxxxxxxxxxxxxxxxxx
> Sorry, missed the part about permissions. You need to be an admin (or some
> funky stuff to do this via AppPool identities) in order to talk to the
> topology stuff.
>
> I *strongly* recommend you *not* to talk to the db directly, even if you
> think it's not doing anything because you're querying it.
>
> If you can't solve a problem with the existing web services and object
> model, then I suggest it's not a problem you should try to solve (or
> change the parameters of the problem to fit within the boundaries of what
> you can do with the object model).
>
> I know that's a sucky answer, but writing code to talk to the database
> directly is bad (and yes, it can work and people do it, I just don't like
> seeing people propagate the behavior).
>
> --
> Bil Simser
> SharePoint MVP, BSc., MCSD
> Calgary, Alberta
> http://weblogs.asp.net/bsimser
>
>
>
> "Dan Marth" <danmarth@xxxxxxxxxxxxx> wrote in message
> news:eFLm1GGaGHA.4916@xxxxxxxxxxxxxxxxxxxx:
>
>> Not by permissions...............if you know how, please share.
>>
>> Dan
>>
>> "Bil Simser [SPS MVP]" <bsimser@xxxxxxx> wrote in message
>> news:Orjqum$ZGHA.3532@xxxxxxxxxxxxxxxxxxxxxxx
>> > You can get it through the classes in the
>> > Microsoft.SharePoint.Portal.Topology namespace.
>> >
>> > --
>> > Bil Simser
>> > SharePoint MVP, BSc., MCSD
>> > Calgary, Alberta
>> > http://weblogs.asp.net/bsimser
>> >
>> >
>> >
>> > "Dan Marth" <danmarth@xxxxxxxxxxx> wrote in message
>> > news:eLk1YS5ZGHA.2376@xxxxxxxxxxxxxxxxxxxx:
>> >
>> >> Seems like this should be easy but I can't seem to find anyway to do
>> >> it
>> >> other than a SQL statement, which I would rather not do since MS
>> >> doesn't
>> >> support querying the DB. I also do need only the top level sites a
>> >> user
>> >> has
>> >> permissions too, so I can't just query the sites list that lives on
>> >> the
>> >> sites area of SPS. Anyone have any ideas?
>> >
>

.



Relevant Pages

  • Re: Get a list of all top level WSS sites in SPS?
    ... this navbar without having to query the SharePoint db. ... SharePoint object model as the database. ... Can you give one reason why someone shouldn't do a simple ... As far as MS not recommend it, ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Get a list of all top level WSS sites in SPS?
    ... SharePoint doesn't look inside the group for the user. ... level WSS or Team Sites. ... SharePoint object model as the database. ... Can you give one reason why someone shouldn't do a simple ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Get a list of all top level WSS sites in SPS?
    ... You'll find it's not something that people have done because it's more of an admin view of a SharePoint server, ... You generally don't setup SharePoint infrastructure to mimic an organization hierarchy, you set it up in a way that makes sense for maintenance and use things like topics and listings to be your navigation. ... > SharePoint object model as the database. ... As far as MS not recommend it, ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Get a list of all top level WSS sites in SPS?
    ... Can you give one reason why someone shouldn't do a simple query ... As far as MS not recommend it, ... I have never heard a *solid* reason for not doing a simple query on the db, ... I also never heard of a SQL database breaking because someone queried it. ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Divert F1 to custom-built help database?
    ... > Why do you recommend against a help database? ... I prefer not to deviate too much from the standard method of doing things ... help is pretty good so there's probably no reason to ditch it. ... problem if you move to another database in the future. ...
    (microsoft.public.vb.general.discussion)