How to Reset the List Item ID
How
to Reset the List Item ID value numbering at 1
One of the most common problems we in SharePoint lists , there is no direct way , the value of the ListItem ID reset. In development environment we used to insert and delete a lot of records and during this time ID value automatically increases as the ID column is an up counter type. Finally , when we move to staging and production environments, the website with backup and restore the ListItem -ID value will not start with 1 .
One way of preventing this problem is update the content Database ListID value to 1
Get The specific content database Name
- Go To the Central Admin
- Application Management
- Click on Manage Content Database
- Select the specific web Application
- Database Name will be shown
Get The specific List ID (GUID)
Method A
1. Navigate to the list and click List Settings.
2. In the browser address bar at the end of the URL you
will find the list id (Guid Format with URL encoding).
3. Example: http://contoso.com/_layouts/15/listedit.aspx?List=%7B00000000%2D0000%2D0000%2D0000%2D000000000000%7D
4. Replace the following characters as follows:
a. %7B to {
b. %2D to –
c. %7D to }
Method B
1.
Open
Microsoft SharePoint Management Shell on a SharePoint server in the farm.
2.
Run
this cmdlet replacing the URL with the URL of the site containing the list: $(Get-SPWebhttp://contoso.com).lists | FT Title, ID
3.
Locate
your list and corresponding ID in the results.
Update the NextAvailableId value on Content database
Go the the specific database
Run the following query
UPDATE <Content DB>.dbo.AllListsAux set NextAvailableId=1 where ListID='<GUID>'
Here you can see a table called AllListsAux. This list maintains Item count and Id details for all lists.
Here you can see a table called AllListsAux. This list maintains Item count and Id details for all lists.
----------------------- Regards, Shashika -----------------------
Good one Shashika
ReplyDeleteThanks
DeleteThanks for sharing..
ReplyDeleteThanks for sharing..
ReplyDeleteGood Stuff! Keep it up :)
ReplyDelete