Click here to Skip to main content
15,880,956 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

I want to discuss with you my one of scenario and want to know the best practice to make it faster and easy.

Suppose, I have one Users table and I have 15,000 Users available in this table, I have one page in which, I can upload only existing users to assign them something, Now here, I want to check that all uploaded users must be exist in the system,

Currently what I am doing!

I am getting all uploaded users email address and join them by "," and pass through SP.

I having split function in DB and I am checking by IN operator in SQL query.
Like "SELECT * FROM USERS WHERE EMAIL IN(SELECT VALUE FROM SPLITFUNCTION(',',@ALLEMAILS))"
and return all existing users.

suppose, If I have 10,000 users in excel sheet then Is it good thing to collect all email address, combine them in string object and pass it into SP?

Option 2
If I get all users from db then every time it will retrieve 15000 users from DB even if I just want to check only 1 or 10 users.

I want to know the other good options except above two,

Note: can not use cache,cookie, etc to store data in server object,
Posted
Updated 4-Dec-13 19:14pm
v2
Comments
Sergey Alexandrovich Kryukov 5-Dec-13 1:14am    
If you develop an ASP.NET site, have database (you say "SQL"), why using such trash as "Excel sheet"? No good.
Despite one question mark, this post is not a question, its purpose is not quite clear.
And, by the way, some thousands users is not many, not at all. I don't understand how it possibly can raise a performance concerns.
—SA
Imran Khan Pathan 5-Dec-13 1:52am    
Yes, I have asp.net site, I have import action in the page, let me explain you in detail.

In my website, many companies can create their account and can upload all employee details, so it is a bed thing to insert one by one employee by a single form, rather then we provided a action to import all employee by uploading excel sheet.

Now in other page, suppose, I have question answer page for particular company, so company can create many questions and they can decide which employee should part of that question. so during creation of questions, company needs to select employees, company can select their employee either from the list or by uploading excel sheet again so in case if company choose to upload excel sheet again then we need to check that all employee should already part of that company.
thatraja 5-Dec-13 10:53am    
To reply someone, use 'Reply' button/widget. Only that way you could send notification to appropriate person.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900