use of host_name( ) in triggers

From: Ida (idapay@yahoo.com)
Date: 05/28/02


From: "Ida" <idapay@yahoo.com>
Date: Tue, 28 May 2002 00:40:40 -0700


Hello! =)

I need to find out who is making scrupulous changes in one
of the database tables. What I did was to create a trigger
for an update event for the affected table. This table
should populate a temporary table that will record the
login, computer name and date (using SYSTEM_USER, HOST_NAME
() and GETDATE() ) in which the changes were made.

My problem is if the host_name is used within the trigger,
the record in the temporary table will have a NULL value
for the host_name. However, if I run "SELECT HOST_NAME()
from the query analyzer, the host_name is returned.

Question: What must I do in order to get the desired
result using HOST_NAME?

I hope to get help from you, guys. Many thanks in advance.
=)

Kind regards,

Ida



Relevant Pages

  • RE: use of host_name( ) in triggers
    ... Dear Ida, ... >I need to find out who is making scrupulous changes in one ... What I did was to create a trigger ... >for an update event for the affected table. ...
    (microsoft.public.sqlserver.security)
  • Re: Error 2950 - Reserved Error on form refresh/requery
    ... and I can't leave the client with an unusable database while I try to ... The requery is on the form (so the data displayed in the sub-forms refreshes ... The triggering event is a listbox after update that does 2 things only: ... can trigger others, and so the problem may occur only when a specific ...
    (microsoft.public.access.formscoding)
  • Re: Help with INSERT TRIGGER - fails with error.
    ... You didn't declare any PRIMARY KEY in this database. ... In an INSERT trigger, ... but I can't get it to work because it references ntext fields. ...
    (comp.databases.ms-sqlserver)
  • Re: Lookup Tables, the right way?
    ... model is comes in un-learning what you know about file systems. ... The users might not all have the same database access rights ... This rule would be enforce by a REFERENCES ... with a trigger that you can do with DRI and more. ...
    (comp.databases.theory)
  • Re: Using one table vs. many
    ... model is comes in un-learning what you know about file systems. ... The users might not all have the same database access rights ... This rule would be enforce by a REFERENCES ... with a trigger that you can do with DRI and more. ...
    (comp.databases)