Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update field with update trigger
Message
De
27/04/2004 18:46:26
 
 
À
27/04/2004 18:26:49
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00898422
Message ID:
00898759
Vues:
11
Hi Daniel,

I'm trying to set the GotUpdated flag in a table when data in the table get updated, 'cause then they have to be printed.

After print the GotUpdated flag gets set to NULL, until somebody else changes the data, at which point the have to be printed...

So, a few tables have the GotUpdated field, and the code is basically the same, which is why I'd hoped for (but not really expected) object reuseability.

Please have a look at the trigger in the latest message to Rollin, and hopefully, all will be clear.

Any and all suggestions for more efficient code are more than welcome!

BR

Peter

>>Rollin,
>>
>>The updates are via ODBC / VFP.
>>
>>I just don't know how to implement the "for all other fields but the SomeTable.GotUpdated field" part
>
>I'm not sure I follow you here. You want to update the GotUpdated field in other tables when GotUpdated gets changed in your target table? Will you be using an additional value out of your target table (say, a foreign key) do map the change in the other tables?
>
>>
>>BTW, with triggers (I assume) being objects in the DB, it should be possible to attach the same trigger to more than 1 table?
>>
>>
>
>On the last, no. You will have to write specific triggers for each table.
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform