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

Database

 
AnswerRe: Data Base administrator vs software developer Pin
Richard MacCutchan2-Jun-13 20:56
mveRichard MacCutchan2-Jun-13 20:56 
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 
Hi,

I have a Master table A(AId, Value) and Detail table B (BId, Value, AId). AId and BId are Identity increment columns. The value field in B comes from some other table C, value field in A table is always the same value: 1.

When I am inserting Detail table B, I am doing it with a select statement on the other table C. The problem is filling the foreign key AId value in Table B. First thing to fill it is, if there is some AId already there in the B table then we have to assign that AId to it.

If there is no AId in the B table for the correspoding value, we have to insert a record in the A table and that AId should be assigned to the AId field of that row. For this given scenarion I am struggling to write a stored procedure.

I tried to write another function to be called inside the stored proc, but funtions in SQL Server dont support Insert inside the UDF.

Now trying to use Stored Procs return values in the Insert statement, I dont know so far no success. I am searching too. If anybody can please help me that would be really great.

Thanks in Advance.
Thanks & Regards,

Abdul Aleem Mohammad
St Louis MO - USA

AnswerRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes1-Jun-13 2:35
professionalMycroft Holmes1-Jun-13 2:35 
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 

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.