Hi Paul, You could just remove the IN clause and use an INNER JOIN between the CallTreeContacts table and the inserted one. You would eventually come up with a set of values, so you need to replace your initial "SET @roleType =" with an ad hoc query.
If you need additional hints please post some more code. HTH -- Efran Cobisi http://www.cobisi.com Paul Cowan wrote:
Hi all, To cut a long strory short I have a trigger where I want to update some totals on another table. THe thing is I have the following line: SET @roleType = (SELECT cc.calltreecontactroleid FROM CallTreeContacts cc WHERE cc.[Uid] IN (SELECT [Uid] FROM inserted)) This works if I update one row but if I update multiple rows I get the following error because I have more than one recored in the Inserted table. Subquery returned more than 1 value This is not really suprising.Is there a way for me to do this one at a time without having to resort to while loops or temorary tables? Cheers [EMAIL PROTECTED] _________________________________________________________________ Who's friends with who and co-starred in what? http://www.searchgamesbox.com/celebrityseparation.shtml =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
=================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com