Solved

Capture add/update record on SQL 2005 table

Posted on 2008-10-28
6
273 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to recover a database from a user managed backup

821 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