dbTalk Databases Forums  

Retrieving actual SQL sent to server

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Retrieving actual SQL sent to server in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Serge
 
Posts: n/a

Default Retrieving actual SQL sent to server - 10-01-2003 , 08:57 PM






If you are using a parameterized query as a data source in
Transform Data Task, is it possible to retrieve the actual
sql statement sent to the server (with the parameters
resolved)?
Using the "SourceSQLStatment" property, retrieves the SQL
with the parameter placeholders (?) instead of the
parameter values.

Thanks
Serge

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Retrieving actual SQL sent to server - 10-02-2003 , 01:19 AM






Yes

Use Profiler.

You could also

Read the SourceSQLStatement. You then need to read the
InputGlobalVariableNames, which is a ; delimited list of GV Values. Match
the first ? to the first value you come across and then the 2nd etc etc.



--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"Serge" <serge_delic (AT) hp (DOT) com> wrote

Quote:
If you are using a parameterized query as a data source in
Transform Data Task, is it possible to retrieve the actual
sql statement sent to the server (with the parameters
resolved)?
Using the "SourceSQLStatment" property, retrieves the SQL
with the parameter placeholders (?) instead of the
parameter values.

Thanks
Serge



Reply With Quote
  #3  
Old   
Serge
 
Posts: n/a

Default Re: Retrieving actual SQL sent to server - 10-02-2003 , 08:46 AM



Thanks Allan.

Profiler won't work since the source is Oracle, not SQL
Server.

Serge

Quote:
-----Original Message-----
Yes

Use Profiler.

You could also

Read the SourceSQLStatement. You then need to read the
InputGlobalVariableNames, which is a ; delimited list of
GV Values. Match
the first ? to the first value you come across and then
the 2nd etc etc.



--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"Serge" <serge_delic (AT) hp (DOT) com> wrote in message
news:0d1601c38888$97ed0a90$7d02280a (AT) phx (DOT) gbl...
If you are using a parameterized query as a data source
in
Transform Data Task, is it possible to retrieve the
actual
sql statement sent to the server (with the parameters
resolved)?
Using the "SourceSQLStatment" property, retrieves the
SQL
with the parameter placeholders (?) instead of the
parameter values.

Thanks
Serge


.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.