Solved

Reverse Engineer a SQL Profiler Trace

Posted on 2006-10-19
5
489 Views
Last Modified: 2008-03-06
I am working with a MSSQL based application that has a COM interface for programming/integration.
If I run a sql trace on the database while entering a record into the application I can clearly see what is going on.
In fact the manufacturer suggests that developers use SQL traces to 'reverse-engineer' the application when
trying to integrate with it.

Here is my current approach:
I take pieces of the sql trace log, visually parse it out, figure out what kind of sql command is being called,
and convert that (in VB) to the appropriate COM calls for the appliations COM object.
The process is a bit tedious.

Does anyone have any suggestions on how to parially automate this process?
I am thinking that I am going to have to write my own parsing logic to parse out the trace log, but just want to be sure
that there is no magic utility out there that already does something similar.

Thanks,  Kevin.
0
Comment
Question by:kevinvw1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
Nightman earned 500 total points
ID: 17766613
None that I know of.

What I can tell you is that any manufacturer/supplier that told me to run a sql trace to see what is happening internally in their application if I need to integrate to it will be shown the door - this indicates poor system documentation (and therefore possibly poor change management and quality control as well). If they don't have a published SDK, they should at LEAST be able to show some system documentaion!
0
 

Author Comment

by:kevinvw1
ID: 17766656
Let me explain -

They actually do have decent documentation, but their COM does not enforce business logic.  For example if you enter a new record via the gui, it populates several tables, enforcing the business logic to insure that a "complete" record is created.  
Create a new company/contact record populates the company, person, address, phone, etc. tables.

When you use the COM object you have to populate each table separately.  Referential integrity checking is up to the programmer.  Hence, to see exactly what is happening, one can take advantage of a sql trace.

Anyway that is their application for better or for worse...FYI it is Sage Software...might as well be microsoft...can't show them the dooe ;)

Thanks,  Kevin.
0
 
LVL 29

Expert Comment

by:Nightman
ID: 17766718
We are on our 3rd Sage 'consultant' at the moment.

Some kind of data dictionary would be REALLY nice here - for you to have to capture the entire application business logic by profiling their system is insane. Do their COM datatypes also match up with the validation on the UI? Unlikely. So how do you know whether or not you have broken the integrity of the system when you post 10 into a tinyint field that the UI only allows 0-9?

Does the database enforce referenctial integrity at all? I.E. enetring a person with an invalid company will error out?

What version of Sage? Which software package? CRM, Accounting, etc...
0
 

Author Comment

by:kevinvw1
ID: 17766803
Sage CRM.

So far in my experience you can use their COM object to write data that the application can't interpret.

I have not messed around with their Web Services yet, so I'm not sure if it does any better job of enforcing things.

For your example, yes, I could create a person record and assign a company id to that person record even if that company id doesn't actually exist in the company table!

I happen to be a Sage 'consultant'...fortunately I am first and foremost a 'programmer'...and debugging other people's apps is my specialty so I feel right at home with this app...lol

Fun stuff.

Thanks, Kevin.

0
 
LVL 29

Expert Comment

by:Nightman
ID: 17766872
No way that I know of to automate this. And ideally you are going to want to work with a single connection to a system at a time (far easier to trace the logic if you know that there is only one connected user). Trying to split out the logic when there are hundreds (or even dozens) of concurrent connections will be painful in the extreme.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

734 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