I have an excel sheet which has the ID of some users , i would like to check if those users exist in a table in database.

What I usually do is, concatenate a comma to the end of each ID in excel using excel formulae and the run below query in DB

select count(*) from <table_name> where EMP_ID in(copy/paste all ID from excel);

But in my present situation it doesn't work, since IN supports a maximum of 1000 value, and I have about 15000 Id's in my excel

Is there any faster and better way to do this?

hi! I think all you have to do is:
-load the employee ids in a temporary table
-join your employee table and the your temporary table by employee id
That's it. i hope it will help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.