Click here to Skip to main content
15,904,822 members
Home / Discussions / Database
   

Database

 
Questionvulnerability Pin
sowjanya315-Jul-10 22:07
sowjanya315-Jul-10 22:07 
AnswerRe: vulnerability Pin
Scubapro16-Jul-10 0:40
Scubapro16-Jul-10 0:40 
AnswerRe: vulnerability Pin
Mycroft Holmes16-Jul-10 12:02
professionalMycroft Holmes16-Jul-10 12:02 
GeneralRe: vulnerability Pin
sowjanya320-Jul-10 18:44
sowjanya320-Jul-10 18:44 
QuestionVery Tough CSV Data Import to SQL 2005 DB Table Challenge Pin
dsabjp14-Jul-10 16:54
dsabjp14-Jul-10 16:54 
AnswerRe: Very Tough CSV Data Import to SQL 2005 DB Table Challenge Pin
Mycroft Holmes14-Jul-10 19:33
professionalMycroft Holmes14-Jul-10 19:33 
GeneralRe: Very Tough CSV Data Import to SQL 2005 DB Table Challenge Pin
dsabjp17-Jul-10 16:37
dsabjp17-Jul-10 16:37 
QuestionIN Clause Best Practices? [solved] Pin
Dan Mos14-Jul-10 6:41
Dan Mos14-Jul-10 6:41 
Hy,

I have a problem in that I don't know what to choose.

We have somewhere DataLayer/BussinessLogic something like:
C#
public class MainClass{
.
.
.
protected ObservableCollection<SecondaryClass> lst;//contected to the main class through IDs in the DB
.
.
.
}


So the question is:

What is the best way to get some rows based on a array/list of IDs from the "main" table:
1) Getting all the MainClass rows/objects than generating a string from code(c#) using StringBuilder with all the IDs separated by commas and run a query/storedproc to get all objects from the realted
table(s) with a string/varchar paramter for the IN clause and fill the list of SecondaryClass objects from the MainClass or
2) Generate a temporary table with the IDs and use that in another
query/proc as the IN or EXISTS filter?

I've run some tests and for some reason or another from the speed point of view the first one is
the winner. But both are pretty fast. So speed alone is not that big of an issue.

Because of the Object Model we can not use a join. I mean we could but makes no sence.

Any suggestions will be apreciated.

Thanks
I bug
modified on Wednesday, July 14, 2010 1:47 PM

AnswerRe: IN Clause Best Practices? Pin
Eddy Vluggen14-Jul-10 7:10
professionalEddy Vluggen14-Jul-10 7:10 
GeneralRe: IN Clause Best Practices? Pin
Dan Mos14-Jul-10 7:24
Dan Mos14-Jul-10 7:24 
GeneralRe: IN Clause Best Practices? Pin
Eddy Vluggen14-Jul-10 7:35
professionalEddy Vluggen14-Jul-10 7:35 
QuestionMessage Removed Pin
14-Jul-10 0:00
AussieLew14-Jul-10 0:00 
AnswerRe: Accessing mdiParent form menu from mdiChild form via code Pin
Richard MacCutchan14-Jul-10 1:28
mveRichard MacCutchan14-Jul-10 1:28 
QuestionAccess 2007 - black hole forms Pin
john john mackey13-Jul-10 7:30
john john mackey13-Jul-10 7:30 
AnswerRe: Access 2007 - black hole forms Pin
Richard MacCutchan13-Jul-10 22:19
mveRichard MacCutchan13-Jul-10 22:19 
GeneralRe: Access 2007 - black hole forms Pin
john john mackey15-Jul-10 12:05
john john mackey15-Jul-10 12:05 
AnswerRe: Access 2007 - black hole forms Pin
Eddy Vluggen14-Jul-10 4:31
professionalEddy Vluggen14-Jul-10 4:31 
GeneralRe: Access 2007 - black hole forms Pin
john john mackey15-Jul-10 12:10
john john mackey15-Jul-10 12:10 
GeneralRe: Access 2007 - black hole forms Pin
Eddy Vluggen15-Jul-10 12:34
professionalEddy Vluggen15-Jul-10 12:34 
QuestionInteresting SQL Server 2008 problem Pin
SomeGuyThatIsMe12-Jul-10 4:10
SomeGuyThatIsMe12-Jul-10 4:10 
JokeRe: Interesting SQL Server 2008 problem Pin
Mycroft Holmes12-Jul-10 14:45
professionalMycroft Holmes12-Jul-10 14:45 
GeneralRe: Interesting SQL Server 2008 problem Pin
SomeGuyThatIsMe13-Jul-10 2:59
SomeGuyThatIsMe13-Jul-10 2:59 
GeneralRe: Interesting SQL Server 2008 problem Pin
Corporal Agarn13-Jul-10 5:12
professionalCorporal Agarn13-Jul-10 5:12 
GeneralRe: Interesting SQL Server 2008 problem Pin
SomeGuyThatIsMe13-Jul-10 5:17
SomeGuyThatIsMe13-Jul-10 5:17 
Questionbcp and int>ASCII code conversion [modified] Pin
devvvy11-Jul-10 20:00
devvvy11-Jul-10 20:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.