Click here to Skip to main content
15,845,196 members
Home / Discussions / Database
   

Database

 
AnswerRe: About Triggers Pin
GuyThiebaut1-Sep-15 23:18
professionalGuyThiebaut1-Sep-15 23:18 
GeneralRe: About Triggers Pin
dili12347-Sep-15 21:28
dili12347-Sep-15 21:28 
QuestionComposite Key Pin
Gilbert Consellado31-Aug-15 23:26
professionalGilbert Consellado31-Aug-15 23:26 
AnswerRe: Composite Key Pin
Eddy Vluggen1-Sep-15 0:02
professionalEddy Vluggen1-Sep-15 0:02 
GeneralRe: Composite Key Pin
Gilbert Consellado1-Sep-15 0:39
professionalGilbert Consellado1-Sep-15 0:39 
GeneralRe: Composite Key Pin
Eddy Vluggen1-Sep-15 1:18
professionalEddy Vluggen1-Sep-15 1:18 
GeneralRe: Composite Key Pin
Gilbert Consellado1-Sep-15 1:38
professionalGilbert Consellado1-Sep-15 1:38 
GeneralRe: Composite Key Pin
Eddy Vluggen1-Sep-15 2:37
professionalEddy Vluggen1-Sep-15 2:37 
The upper uses two fields to identify a single record. The lower one uses a single field; they would allow different things.

I'd recommend to use the smallest set of fields required. Imagine you are the end-user, how do you differentiate between each record? What is it that makes a sample unique?

If a sample can only be identified by giving both a tbl_sample_id and a track_id, they'd need both be part of the key. If either can be used, then the smallest would become the key, and the other a unique index (the upper in the first case, lower in the second case).
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: Composite Key Pin
Gilbert Consellado1-Sep-15 4:04
professionalGilbert Consellado1-Sep-15 4:04 
GeneralRe: Composite Key Pin
Eddy Vluggen1-Sep-15 4:33
professionalEddy Vluggen1-Sep-15 4:33 
GeneralRe: Composite Key Pin
Tim Carmichael1-Sep-15 3:15
Tim Carmichael1-Sep-15 3:15 
GeneralRe: Composite Key Pin
Gilbert Consellado1-Sep-15 4:08
professionalGilbert Consellado1-Sep-15 4:08 
GeneralRe: Composite Key Pin
Tim Carmichael1-Sep-15 4:59
Tim Carmichael1-Sep-15 4:59 
AnswerRe: Composite Key Pin
Wendelius1-Sep-15 4:07
mentorWendelius1-Sep-15 4:07 
GeneralRe: Composite Key Pin
Gilbert Consellado1-Sep-15 4:41
professionalGilbert Consellado1-Sep-15 4:41 
GeneralRe: Composite Key Pin
Wendelius1-Sep-15 20:32
mentorWendelius1-Sep-15 20:32 
AnswerRe: Composite Key Pin
Mycroft Holmes1-Sep-15 13:54
professionalMycroft Holmes1-Sep-15 13:54 
QuestionKnowing if connection failed to sql server in C# Pin
pluss425-Aug-15 22:46
pluss425-Aug-15 22:46 
AnswerRe: Knowing if connection failed to sql server in C# Pin
Jörgen Andersson25-Aug-15 23:25
professionalJörgen Andersson25-Aug-15 23:25 
SuggestionRe: Knowing if connection failed to sql server in C# Pin
Richard Deeming26-Aug-15 3:20
mveRichard Deeming26-Aug-15 3:20 
GeneralRe: Knowing if connection failed to sql server in C# Pin
Jörgen Andersson26-Aug-15 3:43
professionalJörgen Andersson26-Aug-15 3:43 
GeneralRe: Knowing if connection failed to sql server in C# Pin
pluss426-Aug-15 9:08
pluss426-Aug-15 9:08 
Questionquestion for my new project Pin
turion8722-Aug-15 6:09
turion8722-Aug-15 6:09 
AnswerRe: question for my new project Pin
Wendelius22-Aug-15 6:58
mentorWendelius22-Aug-15 6:58 
AnswerRe: question for my new project Pin
Mycroft Holmes22-Aug-15 14:37
professionalMycroft Holmes22-Aug-15 14:37 

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.