none
Eventlog Errors 5586 (Database) and 6398 (Timer) after installation of Sharepoint 2010 SP1

    Question

  • I am running Search Server Express 2010 on a W2k8 Server. After installation of

    sharepointfoundation2010sp1-kb2460058-x64-fullfile-en-us.exe
    spflanguagepack2010sp1-kb2460059-x64-fullfile-de-de.exe
    searchserver2010sp1-kb2460070-x64-fullfile-en-us.exe
    serverlanguagepack2010sp1-kb2460056-x64-fullfile-en-us.exe
    serverlanguagepack2010sp1-kb2460056-x64-fullfile-de-de.exe

    the critical error 6398 and error 5586 occur in the Eventlog (details see below).

    Source: Sharepoint Foundation
    Event ID: 6398
    Task Category: Timer

    Message: The Execute method of job definition Microsoft.SharePoint.Administration.SPSqmTimerJobDefinition (ID bf8c3c45-4e8c-4537-8512-b141a24ea871) threw an exception. More information is included below. Data is Null. This method or property cannot be called on Null values.

    Source: Sharepoint Foundation
    Event ID: 5586
    Task Category: Database

    Unknown SQL Exception 2812 occurred. Additional error information from SQL Server is included below. Die gespeicherte Prozedur 'proc_UpdateStatisticsNVP' wurde nicht gefunden.
    2011-07-05T00:00:16.297: Starting
    2011-07-05T00:00:16.297: Dropping automatically created stats on user tables
    2011-07-05T00:00:16.297: Updating statistics on user indices
    2011-07-05T00:00:16.310: Statistics for dbo.IX_Dependencies_ObjectId are now being updated with default sampling.
    2011-07-05T00:00:16.310: Rebuilding
    2011-07-05T00:00:16.323: Done
    ...
    2011-07-05T00:00:20.220: Statistics for dbo.IX_TimerScheduledJobs_JobId_ServerId are now being updated with default sampling.
    2011-07-05T00:00:20.220: Rebuilding
    2011-07-05T00:00:20.223: Done
    2011-07-05T00:00:20.387: Done updating statistics



    Tuesday, July 05, 2011 6:22 AM

Answers

  • Hi,

    It's a timer job which fails, check ID bf8c3c45-4e8c-4537-8512-b141a24ea871 in your registry. Find the application in your DCOM and grant it local activation right.

     


    Regards

    Henrik A. Halmstrand
    http:/www.sharepointrevealed.com
    http://getspconfig.codeplex.com
    • Marked as answer by Seven M Friday, July 15, 2011 3:10 AM
    Wednesday, July 06, 2011 4:21 PM
  • For those that come across this as I did, you may want to read http://support.microsoft.com/kb/2635071

    MS have identified this issue and will be addressing it.

    This SP is only required on databases with "NameValuePair" tables.  The Content db have them but not all databases do.

    For example, the WSS_Logging db has the proc_UpdateStatistic Stored Proceedure, but not the famous proc_UpdateStatisticNVP Stored Proceedure.  This database does not have any NaveValuePair tables and as such would not need the proc_UpdateStatisticNVP SP. 

    Steve


    Steve Reardon
    • Proposed as answer by DaveHDub Monday, January 23, 2012 11:52 AM
    • Marked as answer by Andreas Kranister Monday, January 23, 2012 12:27 PM
    Tuesday, November 01, 2011 4:53 PM

All replies

  • I am also having the same two errors appearing regularly after the SP1 install for Sharepoint 2010.  I am running Small Business Server 2011 on the problematic machine. 
    Tuesday, July 05, 2011 2:30 PM
  • I have same errors here after SP1.  Just running Foundation Services.
    Wednesday, July 06, 2011 2:05 PM
  • Hi,

    It's a timer job which fails, check ID bf8c3c45-4e8c-4537-8512-b141a24ea871 in your registry. Find the application in your DCOM and grant it local activation right.

     


    Regards

    Henrik A. Halmstrand
    http:/www.sharepointrevealed.com
    http://getspconfig.codeplex.com
    • Marked as answer by Seven M Friday, July 15, 2011 3:10 AM
    Wednesday, July 06, 2011 4:21 PM
  • Hi,

     

    For me it is only id 5586, with the message : 'proc_UpdateStatisticsNVP' unknown. Server is SBS 2008 SP2, after the SP1 of Sharepoint Suite.

    Une exception SQL inconnue 2812 s’est produite. Vous trouverez ci-dessous des informations supplémentaires sur l’erreur issues de SQL Server.
    
    Procédure stockée 'proc_UpdateStatisticsNVP' introuvable.
    2011-07-07T00:04:28.707: Starting
    2011-07-07T00:04:28.707: Dropping automatically created stats on user tables
    2011-07-07T00:04:29.163: Updating statistics on user indices
    2011-07-07T00:04:29.170: Statistics for dbo.IX_Dependencies_ObjectId are now being updated with default sampling.
    2011-07-07T00:04:29.170: Rebuilding
    2011-07-07T00:04:29.477: Done
    2011-07-07T00:04:29.477: Statistics for dbo.IX_Objects_Version are now being updated with default sampling.
    2011-07-07T00:04:29.477: Rebuilding
    2011-07-07T00:04:30.593: Done
    2011-07-07T00:04:30.593: Statistics for dbo.PK_Objects are now being updated with default sampling.
    2011-07-07T00:04:30.593: Rebuilding
    2011-07-07T00:04:30.600: Done
    2011-07-07T00:04:30.600: Statistics for dbo.IX_Objects_ClassId_ParentId_Name are now being updated with default sampling.
    2011-07-07T00:04:30.600: Rebuilding
    2011-07-07T00:04:31.070: Done
    2011-07-07T00:04:31.070: Statistics for dbo.PK_LastUpdate are now being updated with default sampling.
    2011-07-07T00:04:31.070: Rebuilding
    2011-07-07T00:04:31.163: Done
    2011-07-07T00:04:31.163: Statistics for dbo.IX_ServerVersionInformation_ServerId_Product_PatchableUnit_PatchName are now being updated with default sampling.
    2011-07-07T00:04:31.163: Rebuilding
    2011-07-07T00:04:31.167: Done
    2011-07-07T00:04:31.167: Statistics for dbo.IX_TimerLocks_JobId are now being updated with default sampling.
    2011-07-07T00:04:31.167: Rebuilding
    2011-07-07T00:04:31.230: Done
    2011-07-07T00:04:31.230: Statistics for dbo.IX_TimerLocks_JobId are now being updated with default sampling.
    2011-07-07T00:04:31.230: Rebuilding
    2011-07-07T00:04:31.230: Done
    2011-07-07T00:04:31.230: Statistics for dbo.IX_TimerLocks_LockedByServerId are now being updated with default sampling.
    2011-07-07T00:04:31.230: Rebuilding
    2011-07-07T00:04:31.230: Done
    2011-07-07T00:04:31.230: Statistics for dbo.IX_TimerLocks_LockedByServerId are now being updated with default sampling.
    2011-07-07T00:04:31.230: Rebuilding
    2011-07-07T00:04:31.267: Done
    2011-07-07T00:04:31.267: Statistics for dbo.IX_TimerRunningJobs_ServiceId_VirtualServerId_JobId_ServerId are now being updated with default sampling.
    2011-07-07T00:04:31.267: Rebuilding
    2011-07-07T00:04:31.270: Done
    2011-07-07T00:04:31.270: Statistics for dbo.IX_TimerRunningJobs_ServiceId_VirtualServerId_JobId_ServerId are now being updated with default sampling.
    2011-07-07T00:04:31.270: Rebuilding
    2011-07-07T00:04:31.270: Done
    2011-07-07T00:04:31.270: Statistics for dbo.IX_TimerRunningJobs_ServerId_Status are now being updated with default sampling.
    2011-07-07T00:04:31.270: Rebuilding
    2011-07-07T00:04:31.273: Done
    2011-07-07T00:04:31.273: Statistics for dbo.IX_TimerRunningJobs_ServerId_Status are now being updated with default sampling.
    2011-07-07T00:04:31.273: Rebuilding
    2011-07-07T00:04:31.273: Done
    2011-07-07T00:04:31.273: Statistics for dbo.IX_TimerScheduledJobs_JobId_ServerId are now being updated with default sampling.
    2011-07-07T00:04:31.273: Rebuilding
    2011-07-07T00:04:31.277: Done
    2011-07-07T00:04:31.310: Done updating statistics

    Any idea ?

    Thanks by advance,


    Benji
    Thursday, July 07, 2011 7:23 AM
  • I traced my 6398 using failed job history to a failed job for CEIP and disabled it as I don't want to take part.

    I'm still getting the 5586 error

    "Unknown SQL Exception 2812 occurred. Additional error information from SQL Server is included below.

    Could not find stored procedure 'proc_UpdateStatisticsNVP'."

    Can't see anything on the net other than this post :(

    Friday, July 08, 2011 11:50 AM
  • Here is an answer, if indeed is an answer.... makes no sense to me at all:

    http://technet.microsoft.com/en-us/library/ee513056.aspx 

    7 possible fixes for the same error, and in the end it might not be any of them?  Can’t we be a bit more granular?  And if you look at the first fix, you have to know what the users and their permissions should be for a database you might not/probably_have_not ever seen.


    Larry Struckmeyer

    Please post the resolution to your issue so that everyone can benefit

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Seven M Friday, July 15, 2011 3:10 AM
    • Unmarked as answer by Andreas Kranister Friday, August 19, 2011 6:08 AM
    Monday, July 11, 2011 6:43 PM
  • I too am getting the 5586 error everyone else has been citing.

    Resolved the 6398 timer job error by disabling the CEIP timer job.  Chose not to participate during installation so it didn't set up the DCOM rights (however, I had lots of other DCOM permissions issues on this 2K8 R2 install that needed to be resolved) but chose to keep the job enabled.

     

    However, the 5586 job is still stumping me.  June cumulative update has been applied as well.  Error seems to be associated with one of the many timer jobs set to fire off at midnight.  Logs and SQL trace are less than helfpul.


    Here is my trace log with machine names redacted:

    http://pastebin.com/nRzS3sSa

    You can see the error start at 00:00:09  and eventually gets logged to the system Event Log.

    Previous to this section by about 8 seconds is this as well:

    ProfSynch: Exception attempting to enumerate site 0fdc47d8-ba8b-4118-80bc-2c3f550ce590 for ContentDB 5600e140-a111-4fac-9e81-591cb45a6ded: Microsoft.Office.Server.UserProfiles.ProfileSynchronizationInternalException: ProfSynch: The site with ID 0fdc47d8-ba8b-4118-80bc-2c3f550ce590 cannot be synchronized due to an unprovisioned root web.     at Microsoft.Office.Server.UserProfiles.SiteSynchronizerCollection.GetSynchInfoForSite(SqlDataReader dr, SynchInfo info)     at Microsoft.Office.Server.UserProfiles.SiteSynchronizerCollection.<get_Elements>d__0.MoveNext()    acfce251-f634-4724-97c9-8f28d9ecdfc1

    Not sure if it is related, but working on that one as well.

    Wednesday, July 13, 2011 4:23 PM
  • I'm getting the same error on a SPS 2010 SP1 with german language pack.

    This error occurs when procedure 'proc_UpdateStatistics' is called. Inside this procedure allmost at the end there is the line 'EXEC proc_UpdateStatisticsNVP' which causes the error because this procedure is missing. You may change this line to '/***   EXEC proc_UpdateStatisticsNVP   ***/' so that it will not be executed anymore but in the end Microsoft should fix this with an update because maybe they wanted to run some more statistic jobs with the non-existing procedure ;-)

    UPDATE:
    I just created a copy of the procedure in my config database (this is where the error occured) to see if this helps. It's just doing updates in the sys.stats for some NamePairValues (NPV) so it should do no harm.


    • Edited by tw2003 Friday, July 22, 2011 9:42 AM
    Friday, July 22, 2011 7:15 AM
  • I noticed the proc_UpdateStatisticsNVP was missing from some of my databases but not all of them

    It's in SharePoint_AdminContent_guid and SharePointWebDb but not in SharePoint_ConfigurationDatabase.

    Does anyone know if Microsoft is added the SP or removing it?

     

    Friday, July 22, 2011 7:49 AM
  • Looks like they only forgot to put in every database where proc_updateStatistics is used.
    Friday, July 22, 2011 9:45 AM
  • I examined the proc_UpdateStatisticsNVP and it looked harmless enough as it the NameValuePair table didn't exist that it seemed to be doing work with, so I've re-created the proc_UpdateStatisticsNVP in the configuration database and (obviously) no longer get the 5586 error.

     

    Friday, July 22, 2011 3:33 PM
  • I don't have a copy of that procedure in any other databases. If it'not too big, could you post the procedure code?

    Friday, July 22, 2011 3:37 PM
  • It is too big so I'll post in two halves, or you can visit http://www.focusedit.co.uk/blog/post/2011/07/22/SharePoint-5586-Error.aspx

     

    USE [ShareWebDb]
    GO
    /****** Object: StoredProcedure [dbo].[proc_UpdateStatisticsNVP] Script Date: 07/22/2011 16:40:59 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[proc_UpdateStatisticsNVP]
    AS
     SET NOCOUNT ON
     DECLARE @command varchar(8000)
     IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Value' AND object_id = object_id(N'[dbo].[NameValuePair]'))
     BEGIN
      PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePair_Value are now being updated with default sampling.'  
      SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair] NameValuePair_Value' 
      PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
      EXEC (@command)
      PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done'
     END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Albanian_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Albanian_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairAlbanian_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Albanian_CI_AS] NameValuePair_Albanian_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Arabic_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Arabic_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairArabic_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Arabic_CI_AS] NameValuePair_Arabic_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Chinese_PRC_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Chinese_PRC_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairChinese_PRC_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Chinese_PRC_CI_AS] NameValuePair_Chinese_PRC_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Chinese_PRC_Stroke_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Chinese_PRC_Stroke_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairChinese_PRC_Stroke_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Chinese_PRC_Stroke_CI_AS] NameValuePair_Chinese_PRC_Stroke_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Chinese_Taiwan_Bopomofo_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Chinese_Taiwan_Bopomofo_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairChinese_Taiwan_Bopomofo_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Chinese_Taiwan_Bopomofo_CI_AS] NameValuePair_Chinese_Taiwan_Bopomofo_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Chinese_Taiwan_Stroke_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Chinese_Taiwan_Stroke_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairChinese_Taiwan_Stroke_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Chinese_Taiwan_Stroke_CI_AS] NameValuePair_Chinese_Taiwan_Stroke_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Croatian_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Croatian_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairCroatian_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Croatian_CI_AS] NameValuePair_Croatian_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Cyrillic_General_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Cyrillic_General_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairCyrillic_General_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Cyrillic_General_CI_AS] NameValuePair_Cyrillic_General_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Czech_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Czech_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairCzech_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Czech_CI_AS] NameValuePair_Czech_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Danish_Norwegian_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Danish_Norwegian_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairDanish_Norwegian_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Danish_Norwegian_CI_AS] NameValuePair_Danish_Norwegian_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Estonian_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Estonian_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairEstonian_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Estonian_CI_AS] NameValuePair_Estonian_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Finnish_Swedish_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Finnish_Swedish_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairFinnish_Swedish_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Finnish_Swedish_CI_AS] NameValuePair_Finnish_Swedish_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_French_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_French_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairFrench_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_French_CI_AS] NameValuePair_French_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Georgian_Modern_Sort_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Georgian_Modern_Sort_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairGeorgian_Modern_Sort_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Georgian_Modern_Sort_CI_AS] NameValuePair_Georgian_Modern_Sort_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_German_PhoneBook_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_German_PhoneBook_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairGerman_PhoneBook_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_German_PhoneBook_CI_AS] NameValuePair_German_PhoneBook_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Greek_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Greek_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairGreek_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Greek_CI_AS] NameValuePair_Greek_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Hebrew_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Hebrew_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairHebrew_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Hebrew_CI_AS] NameValuePair_Hebrew_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Hindi_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Hindi_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairHindi_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Hindi_CI_AS] NameValuePair_Hindi_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Hungarian_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Hungarian_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairHungarian_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Hungarian_CI_AS] NameValuePair_Hungarian_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Hungarian_Technical_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Hungarian_Technical_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairHungarian_Technical_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Hungarian_Technical_CI_AS] NameValuePair_Hungarian_Technical_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Icelandic_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Icelandic_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairIcelandic_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Icelandic_CI_AS] NameValuePair_Icelandic_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Japanese_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Japanese_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairJapanese_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Japanese_CI_AS] NameValuePair_Japanese_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Japanese_Unicode_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Japanese_Unicode_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairJapanese_Unicode_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Japanese_Unicode_CI_AS] NameValuePair_Japanese_Unicode_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Korean_Wansung_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Korean_Wansung_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairKorean_Wansung_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Korean_Wansung_CI_AS] NameValuePair_Korean_Wansung_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
    

     


    Friday, July 22, 2011 3:43 PM
  •   IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Korean_Wansung_Unicode_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Korean_Wansung_Unicode_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairKorean_Wansung_Unicode_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Korean_Wansung_Unicode_CI_AS] NameValuePair_Korean_Wansung_Unicode_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Latin1_General_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Latin1_General_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairLatin1_General_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Latin1_General_CI_AS] NameValuePair_Latin1_General_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Latvian_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Latvian_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairLatvian_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Latvian_CI_AS] NameValuePair_Latvian_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Lithuanian_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Lithuanian_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairLithuanian_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Lithuanian_CI_AS] NameValuePair_Lithuanian_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Lithuanian_Classic_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Lithuanian_Classic_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairLithuanian_Classic_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Lithuanian_Classic_CI_AS] NameValuePair_Lithuanian_Classic_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Traditional_Spanish_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Traditional_Spanish_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairTraditional_Spanish_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Traditional_Spanish_CI_AS] NameValuePair_Traditional_Spanish_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Modern_Spanish_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Modern_Spanish_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairModern_Spanish_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Modern_Spanish_CI_AS] NameValuePair_Modern_Spanish_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Polish_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Polish_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairPolish_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Polish_CI_AS] NameValuePair_Polish_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Romanian_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Romanian_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairRomanian_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Romanian_CI_AS] NameValuePair_Romanian_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Slovak_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Slovak_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairSlovak_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Slovak_CI_AS] NameValuePair_Slovak_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Slovenian_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Slovenian_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairSlovenian_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Slovenian_CI_AS] NameValuePair_Slovenian_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Thai_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Thai_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairThai_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Thai_CI_AS] NameValuePair_Thai_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Turkish_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Turkish_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairTurkish_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Turkish_CI_AS] NameValuePair_Turkish_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Ukrainian_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Ukrainian_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairUkrainian_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Ukrainian_CI_AS] NameValuePair_Ukrainian_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Vietnamese_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Vietnamese_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairVietnamese_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Vietnamese_CI_AS] NameValuePair_Vietnamese_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Azeri_Cyrillic_90_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Azeri_Cyrillic_90_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairAzeri_Cyrillic_90_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Azeri_Cyrillic_90_CI_AS] NameValuePair_Azeri_Cyrillic_90_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Azeri_Latin_90_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Azeri_Latin_90_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairAzeri_Latin_90_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Azeri_Latin_90_CI_AS] NameValuePair_Azeri_Latin_90_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Chinese_Hong_Kong_Stroke_90_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Chinese_Hong_Kong_Stroke_90_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairChinese_Hong_Kong_Stroke_90_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Chinese_Hong_Kong_Stroke_90_CI_AS] NameValuePair_Chinese_Hong_Kong_Stroke_90_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Divehi_90_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Divehi_90_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairDivehi_90_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Divehi_90_CI_AS] NameValuePair_Divehi_90_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Indic_General_90_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Indic_General_90_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairIndic_General_90_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Indic_General_90_CI_AS] NameValuePair_Indic_General_90_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Kazakh_90_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Kazakh_90_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairKazakh_90_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Kazakh_90_CI_AS] NameValuePair_Kazakh_90_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Macedonian_FYROM_90_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Macedonian_FYROM_90_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairMacedonian_FYROM_90_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Macedonian_FYROM_90_CI_AS] NameValuePair_Macedonian_FYROM_90_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Syriac_90_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Syriac_90_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairSyriac_90_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Syriac_90_CI_AS] NameValuePair_Syriac_90_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Tatar_90_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Tatar_90_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairTatar_90_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Tatar_90_CI_AS] NameValuePair_Tatar_90_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
      IF EXISTS(SELECT 1 FROM sys.stats WHERE name = N'NameValuePair_Uzbek_Latin_90_CI_AS_Value' AND object_id = object_id(N'[dbo].[NameValuePair_Uzbek_Latin_90_CI_AS]'))
      BEGIN
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Statistics for NameValuePairUzbek_Latin_90_CI_AS_Value are now being updated with default sampling.' 
       SELECT @command = N'UPDATE STATISTICS [dbo].[NameValuePair_Uzbek_Latin_90_CI_AS] NameValuePair_Uzbek_Latin_90_CI_AS_Value'
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Rebuilding'
       EXEC (@command)
       PRINT CONVERT(nvarchar, GETDATE(), 126) + ': Done' 
      END
     RETURN 0
    
    

    Or visit http://www.focusedit.co.uk/blog/post/2011/07/22/SharePoint-5586-Error.aspx
    Friday, July 22, 2011 3:44 PM
  • Thank you Mark! That should be one less "normal" error to ignore.
    Friday, July 22, 2011 3:46 PM
  • Solved too for me, thanks Mark !
    Benji
    Sunday, July 24, 2011 8:07 AM
  • Hi Mark,

    could you give me a more detailed tutorial for clearing the 5586 Error with your sample-script? I´m not so familiar with the usage of sharepoint and sql.

     

    Kind Regards

    Roland

     


    Kind Regards Roland Berger - MXP
    Tuesday, July 26, 2011 6:41 AM
  • Hi Mark,

    could you give me a more detailed tutorial for clearing the 5586 Error with your sample-script? I´m not so familiar with the usage of sharepoint and sql.


    Same here. Installing a SBS2010 for a client.

     

    It's sad that these updates don't get real tested before they're sent out - it seems to be a 100% failure rate (all SBS2010 servers).

    Thursday, July 28, 2011 7:35 AM
  • Hi Klaus and Roland,

    here is quick guide. Please be careful when copying code from Mark to not miss any lines.
    1) Open SQL Server Management Studio
    2) Navigate to the database in question (config database)
    3) Got to 'Programmability' and right click 'Stored Procedures'
    4) Select 'New Stored Procedure' (you may also ignore steps 3 and 4 an use the 'New Query' button but with my description you may find the procedure again)
    5) Delete everything that opens in the new tab
    6) Copy the following code and fill your databasename inside the brackets of the 'USE'-Line:

    USE [YOUR_DATABASE_NAME_GOES_HERE]
    GO

    /****** Object:  StoredProcedure [dbo].[proc_UpdateStatisticsNVP]    Script Date: 07/28/2011 10:30:39 ******/
    SET ANSI_NULLS ON
    GO

    SET QUOTED_IDENTIFIER ON
    GO


    CREATE PROCEDURE [dbo].[proc_UpdateStatisticsNVP]

    7) Copy the code from Mark AFTER line 'ALTER PROCEDURE [dbo].[proc_UpdateStatisticsNVP]'
    8) Click on the 'Execute'-Button to create the procedure an you are done.
    9) You may need to refresh the databse node to see the newly created procedure

    Thursday, July 28, 2011 8:44 AM
  • Hi tw2003,

    thanks for your help, it worked for us. i'm looking forward to the next Server-Report tomorrow morning if the error is finaly gone

    Kind Regards

    Roland - MXP

     


    Kind Regards Roland Berger - MXP
    Thursday, July 28, 2011 11:14 AM
  • I have an SBS2011 setup

    When connecting to the DB - finds my SQL instance as (local)

    Login as? - Windows authentification fails (login as server admin)

    Running SQL manager on the server

    TIA

     

    Sunday, July 31, 2011 1:07 PM
  • Try ".\Sharepoint" (without the quotes). Works for me.
    Sunday, July 31, 2011 1:30 PM
  • Unfortunatly Microsoft does not support any change in one of the SP databases. So this is an absolutly no go for production farms.

    I hope Microsoft will ever solve these troubles, including the many dcom permission errors.

    Friday, August 19, 2011 6:14 AM
  • Thank you ! Works like a charm...
    Wednesday, August 24, 2011 3:34 PM
  • For those that come across this as I did, you may want to read http://support.microsoft.com/kb/2635071

    MS have identified this issue and will be addressing it.

    This SP is only required on databases with "NameValuePair" tables.  The Content db have them but not all databases do.

    For example, the WSS_Logging db has the proc_UpdateStatistic Stored Proceedure, but not the famous proc_UpdateStatisticNVP Stored Proceedure.  This database does not have any NaveValuePair tables and as such would not need the proc_UpdateStatisticNVP SP. 

    Steve


    Steve Reardon
    • Proposed as answer by DaveHDub Monday, January 23, 2012 11:52 AM
    • Marked as answer by Andreas Kranister Monday, January 23, 2012 12:27 PM
    Tuesday, November 01, 2011 4:53 PM
  • I did the following to solve the 5586 event: 

    • the first script i used was to get the databases that was missing the dbo.proc_UpdateStatisticsNVP under <database>\<programmability>\<stored procedures> 

    the first script i got from: http://blog.ray1.net/2011/07/could-not-find-stored-procedure.html
     exec sp_msforeachdb 'if exists(select name from [?].sys.objects where type = ''P'' and name like ''%proc_UpdateStatistics%'') AND not exists(select name from [?].sys.objects where type = ''P'' and name like ''%proc_UpdateStatisticsNVP%'') select ''?'''

    • Then I used Mark_Watson27 script but I changed the line from ALTER PROCEDURE [dbo].[proc_UpdateStatisticsNVP] to CREATE PROCEDURE [dbo].[proc_UpdateStatisticsNVP] and used the script on every database that i got listed when running the first script

    Mark_Watson27 script : http://www.focusedit.co.uk/blog/post/2011/07/22/SharePoint-5586-Error.aspx



    Wednesday, December 07, 2011 9:23 AM
  • I wrote a small tutorial on my blog on how to create the missing proc_UpdateStatisticsNVP.

    You just have to copy the procedure from a working database and edit it, so there is nothing you have to download.

    http://blog.scuzz.ca/?p=66

    Sunday, March 25, 2012 5:01 PM
  • You need to read the MS KB, 2635071 (link above), that explains the SP and what databases are supposed to have them.

    They are not missing.  The timer is mistakenly calling on these SP for the effective databases.

    Steve


    Steve Reardon

    Wednesday, March 28, 2012 1:39 PM
  • Nice shiny new SBS install, fully patched and it throws this fault up. MS have known about it for over a year, isn't it about time it was resolved in an SP?
    Thursday, August 23, 2012 7:47 AM