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

Database

 
GeneralRe: Filling many to many rel table using Select statement Pin
indian14317-Oct-15 6:17
indian14317-Oct-15 6:17 
GeneralRe: Filling many to many rel table using Select statement Pin
indian14319-Oct-15 10:30
indian14319-Oct-15 10:30 
QuestionGet check time from separate fields in Microsoft SQL Server Pin
Jassim Rahma14-Oct-15 0:11
Jassim Rahma14-Oct-15 0:11 
AnswerRe: Get check time from separate fields in Microsoft SQL Server Pin
Mycroft Holmes14-Oct-15 1:11
professionalMycroft Holmes14-Oct-15 1:11 
GeneralRe: Get check time from separate fields in Microsoft SQL Server Pin
Chris Quinn14-Oct-15 2:30
Chris Quinn14-Oct-15 2:30 
GeneralRe: Get check time from separate fields in Microsoft SQL Server Pin
Richard Deeming14-Oct-15 2:47
mveRichard Deeming14-Oct-15 2:47 
GeneralRe: Get check time from separate fields in Microsoft SQL Server Pin
Chris Quinn14-Oct-15 2:50
Chris Quinn14-Oct-15 2:50 
QuestionInsert within Select Statement Pin
indian14313-Oct-15 7:50
indian14313-Oct-15 7:50 
Hi All,

I have a situation that I have 3 tables like TabA, TabB and TabC, I have to insert into TabC by using a select statement from TabB but one value I have to take from Scope_Identity from inserting a row into TabA.

So my Insert should look like below.

Insert into TabC (Col1, Col2, TabAId)
Select Col1, Col2, (Insert into TabA(CurrentDate) Values (DateTime) Scope_Identity) FROM TabB.

So the Scope_Identity of the TabA insert should be used in the Select.

Do we have any way to do it? Any sort of advice, code snippet and link is greatly helpful. Thanks in advance.
Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."

AnswerRe: Insert within Select Statement Pin
Richard Deeming13-Oct-15 8:43
mveRichard Deeming13-Oct-15 8:43 
GeneralRe: Insert within Select Statement Pin
indian14313-Oct-15 8:58
indian14313-Oct-15 8:58 
GeneralRe: Insert within Select Statement Pin
indian14313-Oct-15 10:28
indian14313-Oct-15 10:28 
AnswerRe: Insert within Select Statement Pin
Mycroft Holmes13-Oct-15 22:55
professionalMycroft Holmes13-Oct-15 22:55 
QuestionSort GetChildRow datarow array Pin
BobW99912-Oct-15 2:58
BobW99912-Oct-15 2:58 
AnswerRe: Sort GetChildRow datarow array Pin
Mycroft Holmes12-Oct-15 13:07
professionalMycroft Holmes12-Oct-15 13:07 
GeneralRe: Sort GetChildRow datarow array Pin
BobW99912-Oct-15 17:34
BobW99912-Oct-15 17:34 
GeneralRe: Sort GetChildRow datarow array Pin
Mycroft Holmes12-Oct-15 17:40
professionalMycroft Holmes12-Oct-15 17:40 
SuggestionNeed to Optimize this Query Pin
Member 1205173711-Oct-15 23:33
Member 1205173711-Oct-15 23:33 
QuestionTimeline for Work Completion Pin
macca249-Oct-15 0:48
macca249-Oct-15 0:48 
AnswerRe: Timeline for Work Completion Pin
CHill609-Oct-15 2:12
mveCHill609-Oct-15 2:12 
QuestionMSSQL behavior: I need to round instead of truncation when number scale is exceeded Pin
px058-Oct-15 21:32
px058-Oct-15 21:32 
AnswerRe: MSSQL behavior: I need to round instead of truncation when number scale is exceeded Pin
GuyThiebaut8-Oct-15 23:04
professionalGuyThiebaut8-Oct-15 23:04 
GeneralRe: MSSQL behavior: I need to round instead of truncation when number scale is exceeded Pin
px058-Oct-15 23:26
px058-Oct-15 23:26 
AnswerRe: MSSQL behavior: I need to round instead of truncation when number scale is exceeded Pin
Eddy Vluggen9-Oct-15 1:39
professionalEddy Vluggen9-Oct-15 1:39 
AnswerRe: MSSQL behavior: I need to round instead of truncation when number scale is exceeded Pin
Wombaticus10-Oct-15 8:00
Wombaticus10-Oct-15 8:00 
QuestionSql Server Back-end with Access or Asp.net Front-end Pin
macca247-Oct-15 23:23
macca247-Oct-15 23:23 

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.