Re: SQL NEWBEE QUESTION




Richard Wakeman wrote:
What I need to have happen is to have a quick way (SQL) to go thru the
History table, and replace some data into a History Table Field based upon
whether that History records's counter part in the Main Table has been
deleted (not there anymore). We still want to keep History Records of those
deleted in the Main. Am I making any sense?
Shouldn't you rather have your code update the history table when the
main record is deleted?

Anyway, the SQL code for it would be something like:
UPDATE HISTORY.DBF SET HDUPNUM = "1" INNER JOIN MAIN ------- and here I
get lost....

Normally it is something like:
UPDATE HISTORY SET HDUPNUM="1"
WHERE HISTORY.KEY NOT IN (SELECT MAIN.KEY FROM MAIN)

--
Marc

.



Relevant Pages

  • PurgeJobHistory Method-SQLDMO
    ... I want to do is to manage the job history and remove selected job history ... passing the same JobHistoryFilter object to the PurgeJobHistory ... var objJobHistory; ... // I want to remove all the failed history records from the start of the job ...
    (microsoft.public.sqlserver.dts)
  • PurgeJobHistory not constrained by JobHistoryFilter??
    ... I want to do is to manage the job history and remove selected job history ... passing the same JobHistoryFilter object to the PurgeJobHistory ... var objJobHistory; ... // I want to remove all the failed history records from the start of the job ...
    (microsoft.public.sqlserver.programming)
  • Re: How will history be able to record this fact
    ... knob polished to accept bin laden as a prisoner and thereby ... avoid the biggest terrorist attack on America in history. ... History will record the fact that this canard was a pathetic lie used as a talking point by a few rabid right wing assholes as an attempt to deflect blame from Bush and his administration, if history records this trivial footnote at all. ...
    (alt.politics.bush)
  • endpoints of "most recent" range in ordered sequence
    ... Suppose I have a history table with a key, a version of history, and another ... I need to locate the endpoints of the most recent ... range of history records having a set of contiguous null values. ... Tracy Slack ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL NEWBEE QUESTION
    ... the History table when the main record is deleted. ... I needed a routine to go ... deleted (not there anymore). ... UPDATE HISTORY SET HDUPNUM="1" ...
    (alt.comp.lang.borland-delphi)