September 10, 2009 at 8:17 am
Hello
it's possible to retrieve the last operation committed in db and teh ip address of client that execute this operation?
thanks in advance
September 10, 2009 at 7:48 pm
Assuming that the client connected to the SQL Server over TCP/IP then normally , yes.
It depends on what you mean by 'last operation committed' though.
Perhaps you could expand on the requirement a bit?
Are you, for example, interested in just data changes to tables, DDL changes, or...?
Paul
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
September 11, 2009 at 1:40 am
A limited information may be retrived from the Transaction Log file if your database is in Full recovery mode. Otherwise it is almost impossible to get the info.
September 11, 2009 at 1:54 am
depending on what information you are after, you could query the default trace file, there is another recent post that describes how to do that
--------------------------------------------------------------------------------------
[highlight]Recommended Articles on How to help us help you and[/highlight]
[highlight]solve commonly asked questions[/highlight]
Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
Managing Transaction Logs by Gail Shaw[/url]
How to post Performance problems by Gail Shaw[/url]
Help, my database is corrupt. Now what? by Gail Shaw[/url]
September 11, 2009 at 2:42 am
Thanks for your answers. The problem is to understand which user has launched a stored that was cleaning the db.
Thanks
September 11, 2009 at 4:33 am
SELECT client_net_address
FROM sys.dm_exec_connections
WHERE session_id = @@SPID
AND net_transport = N'TCP'
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
September 11, 2009 at 4:59 am
Paul White (9/11/2009)
SELECT client_net_address
FROM sys.dm_exec_connections
WHERE session_id = @@SPID
AND net_transport = N'TCP'
nice, but only works for spids that are still active. still nice to know though.
--------------------------------------------------------------------------------------
[highlight]Recommended Articles on How to help us help you and[/highlight]
[highlight]solve commonly asked questions[/highlight]
Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
Managing Transaction Logs by Gail Shaw[/url]
How to post Performance problems by Gail Shaw[/url]
Help, my database is corrupt. Now what? by Gail Shaw[/url]
September 11, 2009 at 5:26 am
Silverfox (9/11/2009)
nice, but only works for spids that are still active. still nice to know though.
The idea is to include code based on that snippet into the procedure of interest, and log the data somewhere.
I left some thinking and work for the questioner (see my signature) 🙂
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
September 11, 2009 at 6:28 am
Great idea now puts the result of the query log table and the game is done. Too bad they can not know who cleaned the db yesterday.
Thank you for your willingness
😎
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply