Clear all Result_Ids

Clear all Result_Ids

  1. /* 
  2.     WARNING!!! THIS IS A DANGEROUS SCRIPT!!!
  3.     MAKE SURE YOU ARE USING THE RIGHT DATABASE!!!
  4.     This script will clear out all Result_Ids in a database.
  5. */

  6. USE [DATABASENAME];
  7. EXEC sp_MSforeachtable 
  8. 'UPDATE
  9.     ?
  10. SET
  11.     Action_Group = 5000,
  12.     Action_Priority = 5000,
  13.     Action_IsRunning = 0,
  14.     
  15.     Result_Agent = '''',
  16.     Result_Warning = '''',
  17.     Result_Started_At = null,
  18.     Result_Duration = null,
  19.     Result_View_Url = '''',
  20.     Result_Content = '''',
  21.     Result_Content_Url = '''',
  22.     Result_Id = '''',
  23.     Result_ReferenceCode = '''',
  24.     
  25.     Progress_Agent = '''',
  26.     Progress_Started_At = null,
  27.     Progress_Duration = null,
  28.     Progress_Log = '''',

  29.     Error_Agent = '''',
  30.     Error_Date = null,
  31.     Error_ReferenceCode = '''',
  32.     Error_Subject = '''',
  33.     Error_Description = '''',

  34.     Log_History = '''',
  35.     Log_Updated_At = null,
  36.     Log_Duration_Total = null
  37. '


    • Related Articles

    • Convert Any Field into a Picklist

      The following script lets you convert any field into a picklist. --This script will convert any field (usually text fields) into Picklists --and generate Picklist Options from the values. GO DECLARE @Ids Table(Id NVARCHAR(MAX)) INSERT INTO @Ids ...
    • Other: Creating Unique Display Numbers

      The following script will create unique Final_ReferenceCode for all Contacts. It can be easily modified to apply to other record types. Please note that the Final_ReferenceCode that are generated are based on the data in the database. If you are ...
    • Other: Obtaining Record Counts for all Tables

      The following script will count all records in all tables. DECLARE @TableRowCounts TABLE ( [TableName] VARCHAR(128), [Action_Group] INT, [Incomplete] INT, [Complete] INT, [Total] INT ) ; INSERT INTO @TableRowCounts ( [TableName], [Action_Group], ...
    • Prioritizing documents based on different criteria

      The following scripts provide examples that can be modified to apply different priorities to documents. Prioritize Large/Small Documents If you are restoring into a system that has different action limits at different times, this can help you ...
    • Audit Scripts: Row Counts and Progress Monitoring

      This article shows you a script that can be used to monitor the progress of both a Backup and a Restore. It can also be used to just review row counts on all the Universal Database tables. The first code block is used to populate a SQL Server Temp ...