dbTalk Databases Forums  

Setting SourceSQLStatement

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


Discuss Setting SourceSQLStatement in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Spitzer/EC Wise
 
Posts: n/a

Default Setting SourceSQLStatement - 11-11-2003 , 04:30 PM






I've read some docs and posts about how to set the SourceSQLStatement in an
ActiveX script, but I'm dense and can't get it to work. When I read the
package's generated VB script it looks like the definition of the
transformation (Sub Task_Sub2) is running after my ActiveX script (which is
generated as Sub Task_Sub1), so its resetting the SQL back to what's defined
in the transformation.

My code is simply

Function Main()
Dim oPkg, strSQL, oTask, iresult
set oPkg = DTSGlobalVariables.Parent
strSQL = "SELECT gridbits_view.* FROM gridbits_view WHERE store = 111"

set oPump = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask
oPump.SourceSQLStatement = strSQL
iresult = MsgBox(oPump.SourceSQLStatement)
Main = DTSTaskExecResult_Success
End Function

The UI doesn't allow establishing precedence between a script and a
transformation. What do I need to do to change the order?

thanks.



Reply With Quote
  #2  
Old   
Tom Spitzer/EC Wise
 
Posts: n/a

Default Re: Setting SourceSQLStatement - 11-11-2003 , 04:39 PM






Never mind, I figured out how to add the script to the workflow property.



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

Default Re: Setting SourceSQLStatement - 11-12-2003 , 08:54 AM



You can use workflow

Introduction to Workflow
(http://www.sqldts.com/default.aspx?287)

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)

--

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


"Tom Spitzer/EC Wise" <tspitzer (AT) ecwise_Stripme (DOT) com> wrote

Quote:
I've read some docs and posts about how to set the SourceSQLStatement in
an
ActiveX script, but I'm dense and can't get it to work. When I read the
package's generated VB script it looks like the definition of the
transformation (Sub Task_Sub2) is running after my ActiveX script (which
is
generated as Sub Task_Sub1), so its resetting the SQL back to what's
defined
in the transformation.

My code is simply

Function Main()
Dim oPkg, strSQL, oTask, iresult
set oPkg = DTSGlobalVariables.Parent
strSQL = "SELECT gridbits_view.* FROM gridbits_view WHERE store = 111"

set oPump = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask
oPump.SourceSQLStatement = strSQL
iresult = MsgBox(oPump.SourceSQLStatement)
Main = DTSTaskExecResult_Success
End Function

The UI doesn't allow establishing precedence between a script and a
transformation. What do I need to do to change the order?

thanks.





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.