web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

SqlException: Could not find stored procedure 'dbo.p_CascadeCollectAssign'

(0) ShareShare
ReportReport
Posted on by 445

Hi folks

I have an issue with CRM v4 (Rollup 8).

I'm trying to reassign an account (similar problem with reassigning anything else, such as contact etc) and when I choose the new owner I get the usual error message - error occured, try again etc.

When I switch on tracing I get the following exception:

--------

>MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Error Message: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Error Details: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source File: Not available
Line Number: Not available
Stack Trace Info: [SqlException: Could not find stored procedure 'dbo.p_CascadeCollectAssign'.]

--------

I checked and indeed that stored procedure does not exist.  I restored back to a previous date and after a number of attempts of various date restores found an instance where it did exist (23 December). The only change between that stored procedure existing and being removed was an attribute removed from the accounts form (the attribute still exists, just not on the form any longer).

However, I then checked our test system and the stored procedure doesn't exist there either but reassigning accounts and other entities works OK.

Is this stored procedure necessary and how do I get it back?

Any thoughts?

Thanks

Paul

*This post is locked for comments

I have the same question (0)
  • Grzegorz Kalek Profile Picture
    4,210 on at
    Hi, check if you did apply rollup 8 to all components.
  • Paul Taylor Profile Picture
    445 on at

    rollup 8 has been applied to both test and live server as well as all Outlook clients.

  • Grzegorz Kalek Profile Picture
    4,210 on at
    What about the Router and SRS ?
  • Paul Taylor Profile Picture
    445 on at

    Yes, on both of them too.

  • Vincenzo Angeloni Profile Picture
    75 on at

    Hi,

     we have the same problem, have you fixed it yet?

     

    Thanks,

     

    Vincenzo

  • Grzegorz Kalek Profile Picture
    4,210 on at
    Try to reinstall the server rollup.
  • Vincenzo Angeloni Profile Picture
    75 on at

    Hi,

    we have reinstalled the rollup 8 and anyway we still have the same error.

    When we create the new Organization we have checked and the store procedure called p_CascadeCollectAssign does not exist in the organization DB, instead without the rollup8 this store procedure was created in the organization db.

    Do you have anyother suggestions?

     

    Vincenzo

     

  • Grzegorz Kalek Profile Picture
    4,210 on at

    So create this procedure manually, use the script below. Remember to backup the database first ;-)

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_CascadeCollectAssign]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
        drop procedure [dbo].[p_CascadeCollectAssign]
    GO

    create proc p_CascadeCollectAssign
    (
        @operation_type nvarchar(40),
        @root_entity_otc int,
        @root_entity_oid uniqueidentifier,
        @isOffline int,
        @old_owner uniqueidentifier
    )
    as
    begin
        set nocount on
        
        begin
            insert into #CascadeCollectAssign select o, t, p, q, s, y
                     from dbo.fn_CollectForCascadeAssign
                     (@root_entity_oid
                     ,@root_entity_otc
                     ,@isOffline
                     ,@old_owner
                     )
            update #CascadeCollectAssign set processed = 2
        end
    end
    GO


    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_PrimeCascadeWrapper2]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
        drop procedure [dbo].[p_PrimeCascadeWrapper2]
    GO

    create proc dbo.p_PrimeCascadeWrapper2 as
    begin
        create table #CascadeCollect(id INT IDENTITY(1,1) PRIMARY KEY CLUSTERED, objectid UNIQUEIDENTIFIER NOT NULL, objecttype INT NOT NULL, processed INT DEFAULT 0 NOT NULL)
        exec dbo.p_PrimeCascade 'CascadeDelete'
        exec dbo.p_PrimeCascade 'CascadeReparent'
        exec dbo.p_PrimeCascade 'CascadeShare'
        exec dbo.p_PrimeCascade 'CascadeUnShare'
        drop table #CascadeCollect

        create table #CascadeCollectAssign(id INT IDENTITY(1,1) PRIMARY KEY CLUSTERED, objectid UNIQUEIDENTIFIER NOT NULL, objecttype INT NOT NULL, processed INT DEFAULT 0 NOT NULL, parentobjectid UNIQUEIDENTIFIER NOT NULL, parentobjecttype INT NOT NULL, cascading BIT DEFAULT 0 NOT NULL)
        begin
            set nocount off
            set arithabort on
            set ansi_null_dflt_on on
            set implicit_transactions off
            set quoted_identifier on
            set implicit_transactions off
            set cursor_close_on_commit off
            set ansi_warnings on
            set ansi_padding on
            set ansi_nulls on
            set concat_null_yields_null on
            set language us_english
            set dateformat mdy
            set datefirst 7

            declare @fakeid uniqueidentifier
            set @fakeid = newid()

            exec dbo.p_CascadeCollectAssign 'CascadeAssign', 1, @fakeid, 0
        end
        drop table #CascadeCollectAssign

    end
    go



    IF NOT EXISTS (SELECT * FROM StoredProcedureCatalog WHERE StoredProcedureId = '546B0638-D548-4FF8-B3A3-6361F7A35097')
    INSERT INTO StoredProcedureCatalog (StoredProcedureId, Name, DatabaseName, TargetMask, Description)
        VALUES('546B0638-D548-4FF8-B3A3-6361F7A35097', 'p_CascadeCollectAssign', 'mscrm', 1, 'A new sp for hotfix')
    GO

    IF NOT EXISTS (SELECT * FROM StoredProcedureCatalog WHERE StoredProcedureId = 'C97BCF42-276E-432C-81BF-20E399D2667B')
    INSERT INTO StoredProcedureCatalog (StoredProcedureId, Name, DatabaseName, TargetMask, Description)
        VALUES('C97BCF42-276E-432C-81BF-20E399D2667B', 'p_PrimeCascadeWrapper2', 'mscrm', 1, 'A new sp for hotfix')
    GO

  • Paul Taylor Profile Picture
    445 on at

    reinstalling rollup 8 for server restored the stored proc and all working OK.

    Thanks

  • Vincenzo Angeloni Profile Picture
    75 on at

    Hi,

     

    we have uninstalled and reinstalled the rollup 8 and anyway we have the error all the same.

    Could you explain better your procedure?

     

    Thanks,

     

    Vincenzo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans