| Author |
Message |
mriska
Guest
|
Posted:
Tue Jan 11, 2005 8:51 pm Post subject:
Populating a sharepoint list through direct ddatabase connec |
|
|
I was thinking about populating a sharepoint list by doing direct inserts
into the UserData table in the _SITE database. I did some quick test, and
this seems to work, but is there any reason you can think of why I should not
take this road? Of course I would need to know the tp_ListID and the
tp_SiteID, but they are not going to change are they? It also seems as if I
would need to know which fields in the database (nvarchar1...) corresponds to
which columns in the list, but that should also not change once set up.
I guess an alternative way would be to do it through the object model, but
if it is possible (and safe) to do it this way I could get by with a simple
SQL-job that gets executed once per day. |
|
| Back to top |
|
 |
Gary A. Bushey [MVP]
Guest
|
Posted:
Tue Jan 11, 2005 9:18 pm Post subject:
Re: Populating a sharepoint list through direct ddatabase co |
|
|
The big reason is that there is no guarantee the database schema will always
be the same (a service pack could change it), or that you did not miss a
field in another database that needs to be set. I strongly suggest using
the API for this.
--
Gary A. Bushey
SPS MVP
bushey@mindspring.com
"mriska" <mriska@discussions.microsoft.com> wrote in message
news:5BB121CD-7E7F-4FF4-A95C-74C49C4D198C@microsoft.com...
| Quote: | I was thinking about populating a sharepoint list by doing direct inserts
into the UserData table in the _SITE database. I did some quick test, and
this seems to work, but is there any reason you can think of why I should
not
take this road? Of course I would need to know the tp_ListID and the
tp_SiteID, but they are not going to change are they? It also seems as if
I
would need to know which fields in the database (nvarchar1...) corresponds
to
which columns in the list, but that should also not change once set up.
I guess an alternative way would be to do it through the object model, but
if it is possible (and safe) to do it this way I could get by with a
simple
SQL-job that gets executed once per day. |
|
|
| Back to top |
|
 |
Lisa Parris
Guest
|
Posted:
Thu Jan 13, 2005 1:49 pm Post subject:
Re: Populating a sharepoint list through direct ddatabase co |
|
|
There are other ramifications of doing this as well. For instance, when you
add items through the GUI it doesn't just update the UserData table. It also
updates the Lists table's ItemCount and NextAvailableID columns. I haven't
delved in too deeply here but I'm sure there are other issues may not be
immediately apparent.
"mriska" <mriska@discussions.microsoft.com> wrote in message
news:5BB121CD-7E7F-4FF4-A95C-74C49C4D198C@microsoft.com...
| Quote: | I was thinking about populating a sharepoint list by doing direct inserts
into the UserData table in the _SITE database. I did some quick test, and
this seems to work, but is there any reason you can think of why I should
not
take this road? Of course I would need to know the tp_ListID and the
tp_SiteID, but they are not going to change are they? It also seems as if
I
would need to know which fields in the database (nvarchar1...) corresponds
to
which columns in the list, but that should also not change once set up.
I guess an alternative way would be to do it through the object model, but
if it is possible (and safe) to do it this way I could get by with a
simple
SQL-job that gets executed once per day. |
|
|
| Back to top |
|
 |
|
|
|
|