how to identify pc name

  • I want to know how you can identify pc name in sql server

    like any user deleted one table i want to know from which

    pc that table was deleted

    table was already deleted one week ago

  • Are you trying to get Client Host Name from the past records?

    Then you may need to try Log Reader to see which clients connected at that time....

    Incase you are looking to read server name then

    SELECT SERVERPROPERTY('MachineName') will give you Server Host Name.

    For Cluster Servers you can use SELECT SERVERPROPERTY('ComputerNamePhysicalNetBIOS') which will work only in SQL 2005

    Regards,
    Sakthi
    My Blog -> http://www.sqlserverdba.co.cc

  • No actually problem is that we have one common login

    and some tables has been deleted from database xyz now we want

    to know who deleted these table from database xyz

    for this we need pcname from which sql statement

    executed to delete table

  • If you don't already have some form of auditing in place, there's no way you're going to identify historical events. If you're setting up auditing, then you can use the host_name() function or the host_name column in sys.dm_exec_sessions

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • If you have not disabled the default trace you might just be able to figure out what happened. The default trace captures 5 MB of data then rolls over to a new file, and the last 5 files are kept. Look in "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG" for files named log_###.trc. Figure out which one to open based on the timestamps of the files, then load it into profiler and see if you can locate the row that indicates when the table was dropped. You can at least get the hostname from where the drop command was issued.

    Never heard of the default trace? Read this: http://www.sqlservercentral.com/articles/SQL+Server+2005/64547/[/url]

    Kendal Van Dyke
    http://kendalvandyke.blogspot.com/[/url]

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply