Improve the performance of Stored Procedure, by adding the temp table for a subquery
Like employeeId Not In (select d.employeeId from Department d join Projects p on d.deptId = p.deptId)
May be 3 to 4 tables will join , even it is not having data, it is slow due to the subquery in 'Not In',after creating temp table for the subquery and added as Not In (select EmployeeId from #tempDeptEmployees)