Re: One Script, multiple DB's
From: Allan Mitchell (allan_at_no-spam.sqldts.com)
Date: 04/13/04
- Next message: Allan Mitchell: "Re: dts package and t log"
- Previous message: mitra fatolahi: "executing DTS package from Stored Procedure"
- In reply to: Ron Sissons: "Re: One Script, multiple DB's"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Apr 2004 18:40:52 +0100
You certainly can
How to loop through a global variable Rowset
(http://www.sqldts.com/Default.aspx?298)
-- -- 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 "Ron Sissons" <RSISSONS@rcoe.k12.ca.us> wrote in message news:uEF%237lXIEHA.2576@TK2MSFTNGP09.phx.gbl... > 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@no-spam.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").CustomTask > > '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@rcoe.k12.ca.us> wrote in message > news:958DB237-653B-4D74-9221-C1D5D33D25BC@microsoft.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 > > > >
- Next message: Allan Mitchell: "Re: dts package and t log"
- Previous message: mitra fatolahi: "executing DTS package from Stored Procedure"
- In reply to: Ron Sissons: "Re: One Script, multiple DB's"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|