Click here to Skip to main content
15,887,854 members
Home / Discussions / Database
   

Database

 
GeneralRe: Data Base administrator vs software developer Pin
saurabhspk4-Jul-13 9:57
saurabhspk4-Jul-13 9:57 
GeneralRe: Data Base administrator vs software developer Pin
Richard MacCutchan4-Jul-13 20:49
mveRichard MacCutchan4-Jul-13 20:49 
AnswerRe: Data Base administrator vs software developer Pin
Bernhard Hiller2-Jun-13 22:47
Bernhard Hiller2-Jun-13 22:47 
AnswerRe: Data Base administrator vs software developer Pin
jschell3-Jun-13 9:07
jschell3-Jun-13 9:07 
GeneralRe: Data Base administrator vs software developer Pin
SudhirKankal4-Jun-13 23:56
SudhirKankal4-Jun-13 23:56 
AnswerRe: Data Base administrator vs software developer Pin
Saranya-from-Tamil-Nadu-India6-Jun-13 23:58
Saranya-from-Tamil-Nadu-India6-Jun-13 23:58 
QuestionInserting Master and DEtail Tables Pin
indian14331-May-13 14:53
indian14331-May-13 14:53 
AnswerRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes1-Jun-13 2:35
professionalMycroft Holmes1-Jun-13 2:35 
Do this in 2 steps, insert the master record, get the ID and then insert the details records.

I use 2 separate stored procs called from the DAL. The first one inserts the master record and returns the record inserted based on using scope_identity() to get the ID (you can return the ID only if you don't need the entire record.

The second proc inserts the detail records using the ID from the record/integer returned by the first proc.

You can write it into 1 proc but I find that irritating if you need to store more than 1 detail record.
Never underestimate the power of human stupidity
RAH

GeneralRe: Inserting Master and DEtail Tables Pin
indian1431-Jun-13 17:38
indian1431-Jun-13 17:38 
GeneralRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes1-Jun-13 17:59
professionalMycroft Holmes1-Jun-13 17:59 
GeneralRe: Inserting Master and DEtail Tables Pin
indian1432-Jun-13 12:18
indian1432-Jun-13 12:18 
GeneralRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes2-Jun-13 12:35
professionalMycroft Holmes2-Jun-13 12:35 
GeneralRe: Inserting Master and DEtail Tables Pin
indian1432-Jun-13 13:54
indian1432-Jun-13 13:54 
GeneralRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes2-Jun-13 14:29
professionalMycroft Holmes2-Jun-13 14:29 
GeneralRe: Inserting Master and DEtail Tables Pin
indian1432-Jun-13 19:15
indian1432-Jun-13 19:15 
GeneralRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes2-Jun-13 20:02
professionalMycroft Holmes2-Jun-13 20:02 
GeneralRe: Inserting Master and DEtail Tables Pin
indian1433-Jun-13 7:12
indian1433-Jun-13 7:12 
GeneralRe: Inserting Master and DEtail Tables Pin
indian14311-Jun-13 7:59
indian14311-Jun-13 7:59 
GeneralRe: Inserting Master and DEtail Tables Pin
Ralph D. Wilson II10-Jul-13 9:42
Ralph D. Wilson II10-Jul-13 9:42 
Questionquery error Pin
Bhairava Prasad30-May-13 2:03
Bhairava Prasad30-May-13 2:03 
AnswerRe: query error Pin
Anurag Sinha V30-May-13 2:25
Anurag Sinha V30-May-13 2:25 
AnswerRe: query error Pin
Mycroft Holmes30-May-13 12:03
professionalMycroft Holmes30-May-13 12:03 
AnswerRe: query error Pin
Azarudhin4-Jun-13 3:41
professionalAzarudhin4-Jun-13 3:41 
QuestionMultiple Join to the same field Pin
Jassim Rahma29-May-13 4:31
Jassim Rahma29-May-13 4:31 
AnswerRe: Multiple Join to the same field Pin
David Mujica29-May-13 4:56
David Mujica29-May-13 4:56 

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.