5 Replies Latest reply on May 22, 2017 8:13 PM by gcp

    sys.sp_check_constbytable_rowset ??

    gwsmike

      Since this morning, this process has been occupying approx 35%  -  I have no idea what this is or why it's taking so much time.   I have never seen this before and my server has been stable for quite some time.

       

      /* (inserted by DPA)

      Procedure: sys.sp_check_constbytable_rowset

      Character Range: 223 to end

      Waiting on statement:

       

       

      select

      TABLE_CATALOG = s_ccr.TABLE_CATALOG,

      TABLE_SCHEMA = s_ccr.TABLE_SCHEMA,

      TABLE_NAME = s_ccr.TABLE_NAME,

      CONSTRAINT_CATALOG = s_ccr.CONSTRAINT_CATALOG,

      CONSTRAINT_SCHEMA = s_ccr.CONSTRAINT_SCHEMA,

      CONSTRAINT_NAME = s_ccr.CONSTRAINT_NAME,

      CHECK_CLAUSE = s_ccr.CHECK_CLAUSE,

      DESCRIPTION = s_ccr.DESCRIPTION

      from

      sys.spt_check_constbytable_rowset s_ccr

      where

      (

      (@table_schema is null and s_ccr.TABLE_NAME = @table_name) or

      object_id(quotename(@table_schema) + '.' + quotename(@table_name)) = s_ccr.object_id

      ) and

      (@constraint_name is null or s_ccr.CONSTRAINT_NAME = @constraint_name) and

      (@constraint_schema is null or @constraint_schema = schema_name(s_ccr.schema_id))

      order by 1,

      2,

      3,

      4,

      5,

      6

       

       

      */

      create procedure 

      sys.sp_check_constbytable_rowset 

      @table_name sysname, 

      @table_schema sysname = null, 

      @constraint_name sysname = null, 

      @constraint_schema sysname = null 

      as

      /* BEGIN ACTIVE SECTION (inserted by DPA) */ 

         select 

         TABLE_CATALOG = s_ccr.TABLE_CATALOG, 

         TABLE_SCHEMA = s_ccr.TABLE_SCHEMA, 

         TABLE_NAME = s_ccr.TABLE_NAME, 

         CONSTRAINT_CATALOG = s_ccr.CONSTRAINT_CATALOG, 

         CONSTRAINT_SCHEMA = s_ccr.CONSTRAINT_SCHEMA, 

         CONSTRAINT_NAME = s_ccr.CONSTRAINT_NAME, 

         CHECK_CLAUSE = s_ccr.CHECK_CLAUSE, 

         DESCRIPTION = s_ccr.DESCRIPTION 

         from 

         sys.spt_check_constbytable_rowset s_ccr 

         where 

         ( 

         (@table_schema is null and s_ccr.TABLE_NAME = @table_name) or 

         object_id(quotename(@table_schema) + '.' + quotename(@table_name)) = s_ccr.object_id 

         ) and 

         (@constraint_name is null or s_ccr.CONSTRAINT_NAME = @constraint_name) and 

         (@constraint_schema is null or @constraint_schema = schema_name(s_ccr.schema_id)) 

         order by 1,

         2,

         3,

         4,

         5,

         6

      /* END ACTIVE SECTION (inserted by DPA) */