Total Four Steps
1
Create Table#CascadeCollect (IDINT IDENTITY(1,1)PRIMARY KEY CLUSTERED, Objectiduniqueidentifier not NULL, ObjectTypeINT not NULL)2 execDbo.p_cascadecollect'Cascadeshare',10000,'C959c126-ed6d-e611-98e7-000c29835a34',0,'883d4cdc-f3d3-e511-8b46-000c29835a34' --@operation_type ' cascadeshare ' shared--@root_entity_otc 10000 Entityobjectcode--@root_entity_id Record ID--@is_offline 0--@old_owner Record ownerID3
execP_cascadegrantaccess'5f864a79-c96d-e611-a2b0-000c29835a34',8,10000,'C959c126-ed6d-e611-98e7-000c29835a34',1,134217729 --@principal_id uniqueidentifier, this is the ID of the user or team being shared.--@principal_type INT, the user is 8 team for 9--@root_entity_otc int, Entityobjectcode--@root_entity_oid uniqueidentifier, record ID--@access_rights INT,/*When the "Create"/* or hex value 0x20*/ when 1 Then 'Read' when 2 Then 'Write' when 65536 Then 'Delete' /*or hex value 0x10000*/ when 4 Then 'Append' when - Then 'AppendTo' when 524288 Then 'Assign' /*or hex value 0x80000*/ when 262144 Then 'Share' /*or hex value 0x40000*/*/--@inherited_access_rights INT4
Drop Table#CascadeCollect
CRM SQL Sharing