Is there a better way to write the SQL other than using the IN clause in the below given SP. When i am using this IN clause, i suffer a performance dip due to large number or records involved in the User and Member tables.
CREATE PROCEDURE [dbo].[sp_MemberIdsFromUserIds] @dtUserIds UNIQUETABLE readonly AS BEGIN SELECT userID, Memberid FROM Member INNER JOIN USER ON UserMemberID = MemberiD WHERE userID IN (SELECT UniqueId FROM @dtUserIds) END
Kindly suggest the alternative as i don't have a full knowledge in writing SP