Solved

Capture add/update record on SQL 2005 table

Posted on 2008-10-28
6
249 Views
Last Modified: 2013-12-07
Any idea how to capture those "UPDATE" or "ADD" SQL statement under SQL Server Profiler, which event should I look for ?

I have selected the event " SQL:StmtStarting" but couldn't locate any UPDATE or ADD SQL when I create or delete a record in my ERP Application.

Thanks
0
Comment
Question by:AXISHK
  • 3
  • 3
6 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 22828479
Look for SQL:Batch Completed and RPC:Completed.
0
 

Author Comment

by:AXISHK
ID: 22828852
Will the event SQL:Batch Completed , RPC:Completed and SQL:StmtStarting" capture all the update / delete TSQL in SQL 2005 ?

The concern was I could see the remove of header table but couldn't see any SQL statement to remove the detail table ... Will there be a possible of some trigger that will delete the detail table automatically but couldn't log on SQL Profiler. Any way to vertify this ??

Thanks
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22830327
Sure....try it on a test machine and see if everything you think shoudl get captured does.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:AXISHK
ID: 22831810
Is there a way to check all the triggers build on a particular table
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 22831912
select tablename = object_name(parent_id), name from sys.triggers
0
 

Author Comment

by:AXISHK
ID: 22837540
Thanks

One last question, is it possible to also capture the statements executed inside the stored procedure ? I find the profiler could capture the statement like
  "exec J9120.dbo.zdp_pa132 'xxxxxx', 'xxxx".  

However, what is executed inside it couldn't be viewed unless I go to the actual stored procedure and take a look. Is there a way to also view those instruction within SQL profile ?

Many thanks

 
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now