![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
I am trying to figure out thehow to get to the connection properties for a Execute SQL task. I want to change the sql task connection on the fly. Here is what I have. For Each oTask in oPKG.Tasks If oTask.CustomTaskID = "DTSExecuteSQLTask" then ----Here is where I am confused. Where do I find reference to the existing connection property in the task. ----What is the property to access and change the existing connection of an xecute SQL task? Is there a list of properties -------that an execute SQL |
|
msgbox oTask.Properties("Description").value ----End confusion ' Examine Connections For Each oConnection in oPKG.Connections If oConnection.ProviderID = "SQLOLEDB" and oConnection.name = "xxxxxx" Then msgbox oConnection.name & oConnection.datasource & oConnection.description End IF Next End IF Next |
#4
| |||||
| |||||
|
|
Allan Mitchell<allan (AT) no-spam (DOT) sqldts.com> 4/13/2004 8:44:13 AM OK |
|
I am trying to figure out thehow to get to the connection properties for a |
|
I want to change the sql task connection on the fly. Here is what I have. For Each oTask in oPKG.Tasks If oTask.CustomTaskID = "DTSExecuteSQLTask" then ----Here is where I am confused. Where do I find reference to the existing |
|
----What is the property to access and change the existing connection of an xecute SQL task? Is there a list of properties -------that an execute |
|
msgbox oTask.Properties("Description").value ----End confusion ' Examine Connections For Each oConnection in oPKG.Connections If oConnection.ProviderID = "SQLOLEDB" and oConnection.name = "xxxxxx" Then msgbox oConnection.name & oConnection.datasource & oConnection.description End IF Next End IF Next |
#5
| |||
| |||
|
|
OK, I can change the connection that the ExecuteSQL task points to. Now I want to change it 23 times with different datasource and catalog. Would the best way be to put all the connection values in a text file and read them in to change the one connection properties? Ron Sissons, DBA Information Technology Services Riverside County Office of Education 3939 Thirteenth Street, Riverside, CA 92502-0868 Telephone: (909) 826-6471; FAX: [909] 826-6451 Allan Mitchell<allan (AT) no-spam (DOT) sqldts.com> 4/13/2004 8:44:13 AM OK You want to change the properties of the connection to which your ExecuteSQL task points. Does this work for you Function Main() dim pkg, con, tsk 'ref to package set pkg = DTSGlobalVariables.Parent 'Ref to task set tsk = pkg.Tasks("DTSTask_DTSExecuteSQLTask_1").CustomTas k 'The ConnectionID property of the task is the ID of the Connection set con = pkg.Connections(tsk.ConnectionID) 'con.DataSource = Server 'con.Catalog = Database Main = DTSTaskExecResult_Success End Function -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Rsissons" <rsissons (AT) rcoe (DOT) k12.ca.us> wrote in message news:958DB237-653B-4D74-9221-C1D5D33D25BC (AT) microsoft (DOT) com... I am trying to figure out thehow to get to the connection properties for a Execute SQL task. I want to change the sql task connection on the fly. Here is what I have. For Each oTask in oPKG.Tasks If oTask.CustomTaskID = "DTSExecuteSQLTask" then ----Here is where I am confused. Where do I find reference to the existing connection property in the task. ----What is the property to access and change the existing connection of an xecute SQL task? Is there a list of properties -------that an execute SQL task has? msgbox oTask.Properties("Description").value ----End confusion ' Examine Connections For Each oConnection in oPKG.Connections If oConnection.ProviderID = "SQLOLEDB" and oConnection.name = "xxxxxx" Then msgbox oConnection.name & oConnection.datasource & oConnection.description End IF Next End IF Next |
![]() |
| Thread Tools | |
| Display Modes | |
| |