Click here to Skip to main content
15,892,575 members
Home / Discussions / Database
   

Database

 
GeneralRe: What is wrong with my SQL string? Pin
JUNEYT21-Feb-07 3:36
JUNEYT21-Feb-07 3:36 
GeneralRe: What is wrong with my SQL string? Pin
Colin Angus Mackay21-Feb-07 3:55
Colin Angus Mackay21-Feb-07 3:55 
GeneralRe: What is wrong with my SQL string? Pin
JUNEYT21-Feb-07 4:31
JUNEYT21-Feb-07 4:31 
GeneralRe: What is wrong with my SQL string? Pin
peterchen21-Feb-07 11:51
peterchen21-Feb-07 11:51 
GeneralRe: What is wrong with my SQL string? Pin
Pete O'Hanlon21-Feb-07 4:46
mvePete O'Hanlon21-Feb-07 4:46 
AnswerRe: What is wrong with my SQL string? Pin
kubben21-Feb-07 3:27
kubben21-Feb-07 3:27 
GeneralUpdate Advice - Getting most recent value Pin
Brady Kelly21-Feb-07 2:15
Brady Kelly21-Feb-07 2:15 
GeneralRe: Update Advice - Getting most recent value Pin
andyharman21-Feb-07 2:25
professionalandyharman21-Feb-07 2:25 
Hi Brad

Normally you would use a trigger to keep the two tables synchronised. If the tables are currently out of sync then the following should fix the master table:
update DocMaster set
   DocStatus = A.DocStatus,
   UpdateTime = A.UpdateTime
  from DocUpdate A
  where A.DocId = DocMaster.DocId
  and A.UpdateTime = (select max(UpdateTime) from DocUpdate
     where DocUpdate.DocId = DocMaster.DocId)
This assumes that the primary key on DocMaster is named "DocId", and that the "UpdateTime" is unique for each document (if you have an identity column on DocUpdate then you should use that instead).

Hope that helps.
Andy
GeneralRe: Update Advice - Getting most recent value Pin
Brady Kelly21-Feb-07 2:58
Brady Kelly21-Feb-07 2:58 
Questionsome question Pin
Imran Khan Pathan21-Feb-07 1:04
Imran Khan Pathan21-Feb-07 1:04 
AnswerRe: some question Pin
andyharman21-Feb-07 2:38
professionalandyharman21-Feb-07 2:38 
QuestionAverage of all columns Pin
Sam Heller20-Feb-07 11:11
Sam Heller20-Feb-07 11:11 
AnswerRe: Average of all columns Pin
Krish - KP20-Feb-07 17:01
Krish - KP20-Feb-07 17:01 
QuestionProblem in Using ADO in C++ to Get Oracle Ref Cursor Data Pin
Kelvin X Li20-Feb-07 11:02
Kelvin X Li20-Feb-07 11:02 
QuestionCount Problem Pin
ronivars20-Feb-07 9:14
ronivars20-Feb-07 9:14 
AnswerRe: Count Problem Pin
Mark J. Miller20-Feb-07 9:33
Mark J. Miller20-Feb-07 9:33 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 10:15
ronivars20-Feb-07 10:15 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 10:24
ronivars20-Feb-07 10:24 
GeneralRe: Count Problem Pin
Mark J. Miller20-Feb-07 11:52
Mark J. Miller20-Feb-07 11:52 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 12:16
ronivars20-Feb-07 12:16 
GeneralRe: Count Problem Pin
Mark J. Miller20-Feb-07 12:23
Mark J. Miller20-Feb-07 12:23 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 12:50
ronivars20-Feb-07 12:50 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 13:21
ronivars20-Feb-07 13:21 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 12:22
ronivars20-Feb-07 12:22 
QuestionCount Query Prob Pin
tadhg8820-Feb-07 6:39
tadhg8820-Feb-07 6:39 

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.