Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Declaring variable for current record
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
00995317
Message ID:
00995431
Vues:
13
>Thanks Sergey!,
>
>With your code I found some stuff in BOL
>
>"deleted and inserted are logical (conceptual) tables. They are structurally similar to the table on which the trigger is defined, that is, the table on which the user action is attempted, and hold the old values or new values of the rows that may be changed by the user action. For example, to retrieve all values in the deleted table, use:"
>
>And create the following from yours:
>
>
>CREATE TRIGGER SETDEFAULT ON dbo.ss_Description
>FOR INSERT, UPDATE
>AS
>DECLARE @llDefault bit
>
>IF UPDATE(lDefault)
>BEGIN
>  SELECT @llDefault = lDefault  FROM Inserted
>  IF @llDefault = 1
>    BEGIN
>      UPDATE ss_Description SET lDefault = 0
>      WHERE lDefault = 1 AND cFilter = (SELECT cFilter FROM Inserted)
>      AND ID <> (SELECT ID FROM Inserted)
>    END
>END
>
>
>The buzz word I was looking for is INSERTED (This is where my current record is stored)

Once again, there could be more than one (or zero) records in the Inserted table.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform