Blog Home 
Scott Yokiel MOSS 2007 & .NET blog (and some bad spelling) - Increment Sharepoint List ID

RSS 2.0 Atom 1.0 CDF  
 
Sign In
 
 Thursday, May 01, 2008

SO i had the need to increment the ID in one of my lists and it was hairy to try to add and delete items via the API just to do this.  SO i broke down and looked into SQL server.  Open you content db and run a qry like this with you List GUID.  Then go ahead and run the update.  So far so good for me, let me know if i missed something.

SELECT  tp_NextAvailableId, *
FROM         AllLists
WHERE     (tp_ID = 'bcf068c4-d585-4168-8ba8-1f28eb58003c')

--Update AllLists
--set tp_NextAvailableId = 150
--where (tp_ID = 'bcf068c4-d585-4168-8ba8-1f28eb58003c')

5/1/2008 3:50:09 PM (Central Standard Time, UTC-06:00)  #    Comments [0]    |  Trackback
Copyright © 2008 RBA Consulting.