Run timer job on a single content database in sharepoint

public override void Execute(Guid contentDbId)
{
    SPSite siteCollection = new SPSite(mySiteCollectionUrl);
    if (siteCollection.ContentDatabase.Id.Equals(contentDbId))
    {
        // timer job code
    }
}
or
SPJobLockType.ContentDatabase

Comments

Popular posts from this blog

what is Event Cache table in sharepoint

CAML Query syntax and options in SharePoint

Change anchor link url in sharepoint calender