Showing posts with label intercept. Show all posts
Showing posts with label intercept. Show all posts

Monday, March 19, 2012

Intercept SQL Queries sent to DB

Anybody know of a way to view SQL Queries sent to a SQL Server 2000
box ?

I have tried using the 'current activity' option in enterprise
manager, and ODBC tracing but neither show the queries made by this
3rd party app.

I have no db schema and wondered if there was a tool to let me see the
queries sent to my sql server.

Thanks!Vlade writes:
> Anybody know of a way to view SQL Queries sent to a SQL Server 2000
> box ?
> I have tried using the 'current activity' option in enterprise
> manager, and ODBC tracing but neither show the queries made by this
> 3rd party app.
> I have no db schema and wondered if there was a tool to let me see the
> queries sent to my sql server.

Take a look at the Profiler. You find it in the SQL Server program
group.

--
Erland Sommarskog, SQL Server MVP,

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Intercept SQL : Spy / Driver-level / SQL Server Log...

Hello all,
We need to reverse engineer a very large application written in
PowerBuilder / SQL Server to port to .NET.
We have only binaries of application not source code.
What are tools / log facilitites / spy appliations that shall allow us
to see exact SQL that is being carried by driver to SQL server ? Can
we see that in the ASCII form before it gets complied at Server end?
Thanks for your time.
- KA"Kedar Agarkar" <ideas2050@.math.net> wrote in message
news:6e80e9e2.0310080343.48c8a818@.posting.google.com...
> We need to reverse engineer a very large application written in
> PowerBuilder / SQL Server to port to .NET.
> What are tools / log facilitites / spy appliations that shall allow us
> to see exact SQL that is being carried by driver to SQL server ? Can
> we see that in the ASCII form before it gets complied at Server end?
Use the Profiler, unless it's 6.5, in which case us the Trace facility. Good
luck in your project.
Kind Regards, Howard

Intercept SQL : Spy / Driver-level / SQL Server Log...

Hello all,

We need to reverse engineer a very large application written in
PowerBuilder / SQL Server to port to .NET.

We have only binaries of application not source code.

What are tools / log facilitites / spy appliations that shall allow us
to see exact SQL that is being carried by driver to SQL server ? Can
we see that in the ASCII form before it gets complied at Server end?

Thanks for your time.

- KA"Kedar Agarkar" <ideas2050@.math.net> wrote in message
news:6e80e9e2.0310080343.48c8a818@.posting.google.c om...
> We need to reverse engineer a very large application written in
> PowerBuilder / SQL Server to port to .NET.
> What are tools / log facilitites / spy appliations that shall allow us
> to see exact SQL that is being carried by driver to SQL server ? Can
> we see that in the ASCII form before it gets complied at Server end?

Use the Profiler, unless it's 6.5, in which case us the Trace facility. Good
luck in your project.

Kind Regards, Howard

Intercept Result

Hi,

I am trying to write a system (Stored Proc, View, CLR Proc, ?), where if you query a specific table and it returns data from only 1 column for the submitted SELECT statement then substitute data obtained from an external web service.

Does anyone have any suggestions about how best to implement this? I have searched through the BOL but nothing directly deals with what I want to do.

Thanks,

Blair

P.S. I am using SQL SERVER 2005 ENT Edition with everything available.

Hi,

I'm not very clear with your question.

For substituting a result, you can use CASE within your SELECT statement.

Assuming Table1 table with Col1 as column, and a scalar valued function CLRFunction() which will call a web service,

SELECT CASE Col1
WHEN 'abc' THEN CLRFunction(1)
WHEN 'def' THEN CLRFunction(2)
END 'Col1'
FROM Table1

Here 'abc' and 'def' are the values stored in Col1 of Table1

Hope this answers for your query, else please explain your requirement with some more detail.

Regards

Babu

|||

Thanks that is exactly what I was looking for. I now know what to do.

blair

|||

Hello...

I think calling a webservie inside a SP is not a very good behavior. You should write your SPs so that they finish as fast as possible. If you try to access an outside resource you never know how long it will take(and a webservice is even worse). You should consider moving this logic into your application. Also you need to access external resources in that function, so you have to declare it as "unsafe" which will also have some implications on security...

Also it will be more complicated to make your app responsive while your code is waiting on the SQL Server. Calling a webservice async is very easy... Calling SQL is a little more work (but still no big deal)

intercept pipeline events programmatically

Hello,

I'm wish to receive pipeline events fired by a SSIS package.

I execute the package successufully with the following code (c#):

MyEventListener eventListener = new XplorerEventListener();
DtsApplication app = new DtsApplication();
Package pkg = app.LoadPackage("c:\test.dstx", null);
pkg.Execute(null, null, eventListener, null, null);

MyEventListener is inherited from DefaultEvents, overriding all OnXXX methods.

It works perfectly, however I cannot intercept the following events:

- PipelineExecutionTrees
- PipelineExecutionPlan
- PipelineExecutionInitialization
- BufferSizeTuning
- PipelineInitialization

Anyone knows how to catch those pipeline events?
TIA,
Paolo.

I believe that at least some of those are log events and you need to intercept them by implementing an IDTSLogging interface.

Harry