Re: One Script, multiple DB's

From: Allan Mitchell (allan_at_no-spam.sqldts.com)
Date: 04/13/04


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
>
>
>
>


Relevant Pages

  • Re: Error "SQL Server does not allow remote connections"
    ... The application could not connect to the sql server db. ... network is blocking the connection. ... SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 ... integratedSecurity, SqlConnection owningObject) +737554 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Connection from remote computer to network SQL Server
    ... There is no firewall on the W2K machine acting as the SQL server. ... I tried making the SQL machine a "trusted" on the router. ... connection works. ... To find the IP address of your computer inside the network, ...
    (microsoft.public.access.adp.sqlserver)
  • ADO.net Orcas Samples Install Problem
    ... An error has occurred while establishing a connection to the server. ... When connecting to SQL Server 2005, this failure may be caused by the ... SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, ... or am I better off with a full SQL Server install. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Exception trying to import data from Excel .
    ... An attempt to install Microsoft SQL Server 2005 this week has not gone ... The connection type "EXCEL" specified for connection manager ... to create a connection manager for an unknown connection type. ...
    (microsoft.public.sqlserver.tools)
  • Re: SQL Compact Edition - Connection Pool --> Slow!
    ... You might want to check out my EBook on SQL Server Compact. ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... mind (--> get a connection, use it and release it as soon as possible ...
    (microsoft.public.sqlserver.ce)