The solution is a bit more complex, as far as i managed to see.
First thing is to execute the following query:
select subject
, RegardingObjectIdName
, statecodename
, owneridname
, Activitytypecodename
, CreatedOn
from filteredactivitypointer ap
where not exists(select *
from filteredactivityparty ay
where ap.activityid=ay.activityid
and ay.participationtypemaskname = 'Owner')
This query should yield all activities that do not have an Owner defined as an activity party.
After this i took all the subjects and using an Advanced Find query deleted all these activities, that were invalid.
The next thing is to find all activities that have defined more than one Activity Party of type Owner.
select subject
, RegardingObjectIdName
, statecodename
, owneridname
, Activitytypecodename
, CreatedOn
from filteredactivitypointer ap
where (select COUNT(1)
from filteredactivityparty ay
where ap.activityid=ay.activityid
and ay.participationtypemaskname = 'Owner') > 1
These should either be corrected with only one Owner(either directly in the database, or by using re-assign).
This thread helped: http://social.microsoft.com/Forums/en-US/6f67ffaa-7162-4030-b2ee-af23af6b4cf5/error-when-assigning-certain-record-in-crm-error-there-should-be-only-one-owner-party-for-an?forum=crm even if it's for CRM 4.0, it worked also on 2011.