• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

Capture add/update record on SQL 2005 table

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
AXISHK
Asked:
AXISHK
  • 3
  • 3
1 Solution
 
chapmandewCommented:
Look for SQL:Batch Completed and RPC:Completed.
0
 
AXISHKAuthor Commented:
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
 
chapmandewCommented:
Sure....try it on a test machine and see if everything you think shoudl get captured does.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
AXISHKAuthor Commented:
Is there a way to check all the triggers build on a particular table
0
 
chapmandewCommented:
select tablename = object_name(parent_id), name from sys.triggers
0
 
AXISHKAuthor Commented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now