dbTalk Databases Forums  

Finding the user who do update in Query Analyser?

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Finding the user who do update in Query Analyser? in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
LaMoRt
 
Posts: n/a

Default Finding the user who do update in Query Analyser? - 11-20-2007 , 07:39 AM






Hi there!

Is there any way to find the user who did some transaction of update
in query analyser in certain time ?

The update was done manually in query analyser and is not through
system.
Is there any way to check it?

Any command or software to check this data as when certain table was
updated?

Thanks for the help!

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Finding the user who do update in Query Analyser? - 11-20-2007 , 04:42 PM






LaMoRt (cwei83 (AT) gmail (DOT) com) writes:
Quote:
Is there any way to find the user who did some transaction of update
in query analyser in certain time ?

The update was done manually in query analyser and is not through
system.
Is there any way to check it?

Any command or software to check this data as when certain table was
updated?
A log reader tool might help you, although I would not really expect
the application name to be in the log. There are several vendors that
market log readers: Lumigent, Log PI, Red Gate to name a few.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #3  
Old   
Ed Murphy
 
Posts: n/a

Default Re: Finding the user who do update in Query Analyser? - 11-20-2007 , 06:31 PM



LaMoRt wrote:

Quote:
Is there any way to find the user who did some transaction of update
in query analyser in certain time ?

The update was done manually in query analyser and is not through
system.
Is there any way to check it?

Any command or software to check this data as when certain table was
updated?
You can create a trigger on one table that adds rows to a second audit
table. See http://doc.ddart.net/mssql/sql70/create_8.htm

Note that a single INSERT/UPDATE/DELETE may affect multiple rows at
once, so your trigger logic must account for this possibility.

You can get the current user's identity from USER_NAME() or
SYSTEM_USER() or SESSION_USER() - unfortunately I don't understand
how the last two are different from the first, so someone else will
have to fill that in.


Reply With Quote
  #4  
Old   
BerndB
 
Posts: n/a

Default Re: Finding the user who do update in Query Analyser? - 11-21-2007 , 06:04 AM



How about DDL triggers in SQL 2005
"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> schrieb im Newsbeitrag
news:Xns99EEF236F30C4Yazorman (AT) 127 (DOT) 0.0.1...
Quote:
LaMoRt (cwei83 (AT) gmail (DOT) com) writes:
Is there any way to find the user who did some transaction of update
in query analyser in certain time ?

The update was done manually in query analyser and is not through
system.
Is there any way to check it?

Any command or software to check this data as when certain table was
updated?

A log reader tool might help you, although I would not really expect
the application name to be in the log. There are several vendors that
market log readers: Lumigent, Log PI, Red Gate to name a few.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx



Reply With Quote
  #5  
Old   
Greg D. Moore \(Strider\)
 
Posts: n/a

Default Re: Finding the user who do update in Query Analyser? - 11-21-2007 , 06:35 AM



"BerndB" <bernd (AT) fernuni-hagen (DOT) de> wrote

Quote:
How about DDL triggers in SQL 2005
Wouldn't really help here. (Technically you want DML triggers, which were
available in SQL 2000 also).


Quote:
"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> schrieb im Newsbeitrag
news:Xns99EEF236F30C4Yazorman (AT) 127 (DOT) 0.0.1...
LaMoRt (cwei83 (AT) gmail (DOT) com) writes:
Is there any way to find the user who did some transaction of update
in query analyser in certain time ?

The update was done manually in query analyser and is not through
system.
Is there any way to check it?

Any command or software to check this data as when certain table was
updated?

A log reader tool might help you, although I would not really expect
the application name to be in the log. There are several vendors that
market log readers: Lumigent, Log PI, Red Gate to name a few.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx




--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html




Reply With Quote
  #6  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Finding the user who do update in Query Analyser? - 11-21-2007 , 04:13 PM



BerndB (bernd (AT) fernuni-hagen (DOT) de) writes:
Quote:
How about DDL triggers in SQL 2005
With all sorts of triggers you can capture a lot - but only if you plan
ahead. I understoof the original question as that what shouldn't happen
had already happened.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #7  
Old   
LaMoRt
 
Posts: n/a

Default Re: Finding the user who do update in Query Analyser? - 11-22-2007 , 03:29 AM



On Nov 22, 6:13 am, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Quote:
BerndB (be... (AT) fernuni-hagen (DOT) de) writes:
How about DDL triggers in SQL 2005

With all sorts of triggers you can capture a lot - but only if you plan
ahead. I understoof the original question as that what shouldn't happen
had already happened.

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Yes, it is a data that has been updated and i want to track back the
person
who did the transaction. Any way to find it in this kind of situation.
I'm using SQL2000 actually. So anything that can help me for this?

Thanks.



Reply With Quote
  #8  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Finding the user who do update in Query Analyser? - 11-22-2007 , 04:32 PM



LaMoRt (cwei83 (AT) gmail (DOT) com) writes:
Quote:
Yes, it is a data that has been updated and i want to track back the
person
who did the transaction. Any way to find it in this kind of situation.
I'm using SQL2000 actually. So anything that can help me for this?
If the database is in full recovery, you could use a log reader. There
are a couple on the market, and I've lost track of them all. Lumigent
was the first in this field, and for a long time the only player on
the market. Log PI has also been around for a while now. I see that
Red Gate has SQL Log Rescue which currently is free.

If the database is in simple recovery, or you have truncated the log
without backing it up since this update appeared, you can forget about it.

And I should add that even with a log reader, it can be quite a tedious
task to find the culprit.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #9  
Old   
LaMoRt
 
Posts: n/a

Default Re: Finding the user who do update in Query Analyser? - 11-26-2007 , 09:07 PM



On Nov 23, 6:32 am, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Quote:
LaMoRt (cwe... (AT) gmail (DOT) com) writes:
Yes, it is a data that has been updated and i want to track back the
person
who did the transaction. Any way to find it in this kind of situation.
I'm using SQL2000 actually. So anything that can help me for this?

If the database is in full recovery, you could use a log reader. There
are a couple on the market, and I've lost track of them all. Lumigent
was the first in this field, and for a long time the only player on
the market. Log PI has also been around for a while now. I see that
Red Gate has SQL Log Rescue which currently is free.

If the database is in simple recovery, or you have truncated the log
without backing it up since this update appeared, you can forget about it.

And I should add that even with a log reader, it can be quite a tedious
task to find the culprit.

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


Thanks will try it out..


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.