cancel
Showing results for 
Search instead for 
Did you mean: 

Hardware Computer Name in LOG

Former Member
0 Kudos

Hello Experts,

Is the system name being captured while we enter any document ?

I mean can we see the LOG that on which computer / terminal user has entered any specific document(s).

Help Required ...

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

Hi Muhammed

As far as I know, NO. We had a similar request from a customer to stamp the MAC ID of each user to each transaction. You can see which machine name and MAC ID is currently using the system from the SQL management studio or using a query. Try the following query and change the computer name from peter_laptop to blank for a complete list, as well as the DB ID to the internal ID of the database the users are logging onto to.

-- cleanup

if (object_id(N'tempdb..#snapshot_processinfo') is not null)

exec(N'drop table #snapshot_processinfo')

if (object_id(N'tempdb..#snapshot_lockinfo' ) is not null)

exec(N'drop table #snapshot_lockinfo' )

if (object_id(N'tempdb..#snapshot_processinfofltr') is not null)

exec(N'drop table #snapshot_processinfofltr')

-- build snapshot containing info about processes #snapshot_processinfo

select

[Process ID] = p.spid,

[IsSystemProcess] = case when s.is_user_process = 1 then 0 else 1 end,

[User] = p.loginame,

[Database] = p.dbid,

[DB Name] = ISNULL(db_name(p.dbid),N''),

[Status] = p.status,

[Open Transactions] = p.open_tran,

[Command] = p.cmd,

[Application] = p.program_name,

[Wait Time] = p.waittime,

[Wait Type] = case when p.waittype = 0

then N''

else p.lastwaittype

end,

[Wait Resource] = case when p.waittype = 0

then N''

else p.waitresource

end,

[CPU] = p.cpu,

[Physical IO] = p.physical_io,

[Memory Usage] = p.memusage,

[Login Time] = p.login_time,

[Last Batch] = p.last_batch,

[Host] = p.hostname,

[Net Library] = p.net_library,

[Net Address] = p.net_address,

[Blocked By] = p.blocked,

[Blocking] = 0,

[Execution Context ID] = p.ecid,

[ID] = IDENTITY(int, 1, 1),

[ROW ID] = 0

into #snapshot_processinfo

from master.dbo.sysprocesses p, master.sys.dm_exec_sessions s

with (NOLOCK)

where p.spid = s.session_id and p.loginame = 'sa' and p.program_name = 'SAP Business One' and p.hostname = 'PETER_LAPTOP' and p.dbid = 9 -- Database name cannot be used, must use internal ID

order by p.spid

update #snapshot_processinfo

set [ROW ID] = [ID]

SELECT * FROM #snapshot_processinfo

Remember square brackets will be replaced by backslashes and colon.

Kind regards

Peter Juby