Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Triggers
Message
 
À
07/06/1999 13:17:30
Christian Bellavance
Université du Québec à Hull
Hull, Québec, Canada
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00227039
Message ID:
00227344
Vues:
22
Hello Christian:

Do you know how to retrieve a value for who, what program, what ODBC connection, etc. actually sent the command to SQL Server? That would be nice to have in the audit trail table also.



>Your error comes from the values statement. You can not use the deleted and inserted table just like that. Those tables are like every other table in SQL server, you must use them via a select statement.
>
>Ex.
>insert AUDITTABLE (AUD_TABLENAME,AUD_COLNAME,AUD_OLD,AUD,NEW,AUD_DATE,AUD_LANID,COMPNO)
>select 'customertable','cus_name',d.cus_name,i.cus_name,getdate(),i.lanid,i.compno)
>from inserted i
>inner join deleted d on d.cus_number = i.cus_number
>
>Note: I assume that you have a cus_number which is the primary key of your customertable.
>
>Another things is that you do not have to use into since your table is already created.
Richard DeZeeuw
DeZeeuw Software Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform