Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting executed SQL strings

0 views
Skip to first unread message

Matt

unread,
Nov 30, 1999, 3:00:00 AM11/30/99
to
Hello,


I am attempting to retrieve the actual SQL string that is executed when I
call CCommand->Open(); I have used the ICommandText interface and
GetCommandText, but that only returned the string that I passed into the
Open call.

My problem is that when I insert data I don't use an SQL string, but rather
bind data and call CCommand->Insert() and then allow OLE DB to handle the
underlying details of creating the actual SQL string and executing it on my
datasource. I am looking for a way to retreive this final string that OLE DB
creates.

Anyone come across this?

Thanks,

-matt

Bob Beauchemin

unread,
Nov 30, 1999, 3:00:00 AM11/30/99
to
Hi Matt,
Since the OLE DB provider is doing the update using TDS code, it doesn't
set the string in the Command object. If you are using client-side cursor
(DBPROP_CLIENTCURSOR), the client cursor library will build a SQL string,
but you don't have access to it, either.
You can SEE what's going on by using SQL Trace.

Bob Beauchemin
bo...@develop.com


Matt <mh...@one.net> wrote in message
news:ewFJPh4O$GA....@cppssbbsa02.microsoft.com...

Matt

unread,
Dec 1, 1999, 3:00:00 AM12/1/99
to
that is why I want to get the SQL strings, is so I can log them to a file. I
am not familiar with the SQLTrace facility, is there somehwere I can go to
get some information on it.

thanks,

-Matt

Bob Beauchemin

unread,
Dec 1, 1999, 3:00:00 AM12/1/99
to
Its a utility that comes with SQL Server. In SQL Server 7.0 it was
renamed SQL Profiler.

Bob Beauchemin
bo...@develop.com


Matt <mh...@one.net> wrote in message

news:O4AqPOAP$GA....@cppssbbsa02.microsoft.com...

0 new messages