Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting Insert vs Update Trigger event
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 7.0
Divers
Thread ID:
01232029
Message ID:
01232136
Vues:
13
Thanks Naomi,

That is what I was attempting and couldn't get it from the query I was trying that I replicated from another person's stored procedure... Apparently THEY were never getting a result on INSERT either...

Anyhow, I got what I needed by doing a FULL outer join query... Your input on the record count from inserted and deleted was on target with my thoughts, but couldn't get and now I do...

Thanks


>>Hi all,
>>
>>I have a trigger that I'm trying to modify. It needs to be run on EITHER an Insert OR an Update and have it as...
>>
>>ALTER TRIGGER dbo.somast_email_credit ON somast
>> AFTER UPDATE, insert
>> AS
>>
>>...
>>...
>>...
>>
>>
>>Now, while in the trigger, is there some @@ variable, or trigger status that identifies if it was triggerd by an Insert vs an Update?
>>
>>Thanks
>
>Check http://www.developersdex.com/sql/message.asp?p=580&r=5790266
>
>e.g. if exists (select 1 from deleted) and exists (select 1 from inserted)
> ' update
>
>BTW, you have better control in different databases for this question, as I just learned.
>http://www.postgresql.org/docs/8.0/interactive/plpgsql-trigger.html
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform