troubleshooting Question

what can I use in SQL 2000 for "Not in" command that works only in SQL2005

Avatar of obrech
obrech asked on
Microsoft SQL Server 2005SSRS
4 Comments1 Solution171 ViewsLast Modified:
I cannot run this script in the SQL server 2000. The not in does not exist in SQL2000. What statement can I run instead.  i need to retrieve  records only from tblemp table that do not exists in ActiveDirectoryAllUsers table.
can you please write the example for me ( I am not a programmer)

I have the following error when I run this statment "Msg 116, Level 16, State 1, Line 1 Only one expression can be specified in the select list when the subquery is not introduced with EXISTS."

Thank you.

select emp_no, emp_Fname, emp_Lname, emp_MI 
from tblemp
where emp_no not in
(select emp_no, emp_Fname, emp_Lname, emp_MI 
from tblemp as e, ActiveDirectoryAllUsers as a
where e.emp_no = a.employeeID 

Open in new window

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros