|  | Posted by Erland Sommarskog on 12/04/07 22:33 
Hugo Kornelis (hugo@perFact.REMOVETHIS.info.INVALID) writes:>>Another column could be used to track who changed it. Is there a neat
 >>way to determine username, machine name, MAC address or any other
 >>method? I pretty wide open on this one as I am not sure what I want to
 >>use here.
 >
 > Check out SUSER_SNAME() and HOST_NAME() in Books Online.
 
 There's far too many functions for the current user for it to be
 healthy.
 
 The best to use, though, is probably original_login(), because the
 others (SESSION_USER, SYSTEM_USER, suser_sname() etc) gives incorrect
 information if there is an EXECUTE AS clause somewhere along the line.
 
 
 
 --
 Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
 
 Books Online for SQL Server 2005 at
 http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
 Books Online for SQL Server 2000 at
 http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
  Navigation: [Reply to this message] |