Friday, March 9, 2012

DTS package

I have a DTS package which imports data from an Excel spreadsheet into an SQ
L
Server database. The package works fine, but I would like to take the
package to the next step in automation. How could I call the package(from V
B
.Net or QA) to be executed with only one change in the package: the name of
the excel spreadsheet and corresponding worksheet'
Thanks
ArcherSee
http://www.sqldts.com/default.aspx?292
for file manipulation.
You can call run the DTS Package from the command line with DTSrun.exe and
then pass a global variable to the package as a parameter with the /A
switch. (See dtsrun in Books Online) Alternatively, from VB or VB.Net, you
can instantiate a DTS Package object and run that. A DTSPackage has a
GlobalVariables collection that you can populate and an Execute method to
run it.(See "Executing DTS Packages with the DTS Object Model" in Books
Online for more details)
Jacco Schalkwijk
SQL Server MVP
"bagman3rd" <bagman3rd@.discussions.microsoft.com> wrote in message
news:FB2C9E14-2229-49CE-B464-16564F1FA557@.microsoft.com...
>I have a DTS package which imports data from an Excel spreadsheet into an
>SQL
> Server database. The package works fine, but I would like to take the
> package to the next step in automation. How could I call the package(from
> VB
> .Net or QA) to be executed with only one change in the package: the name
> of
> the excel spreadsheet and corresponding worksheet'
> Thanks
> Archer|||There's a couple ways you could do this...
Using parameters:
http://www.sqldts.com/default.aspx?234
DTS in VB.Net
http://www.sqldts.com/default.aspx?265
There's tons of DTS info on this site...
"bagman3rd" wrote:

> I have a DTS package which imports data from an Excel spreadsheet into an
SQL
> Server database. The package works fine, but I would like to take the
> package to the next step in automation. How could I call the package(from
VB
> .Net or QA) to be executed with only one change in the package: the name o
f
> the excel spreadsheet and corresponding worksheet'
> Thanks
> Archer|||here is some code from the microsoft site:
Dim dtsp As New DTS.Package
dtsp.LoadFromSQLServer( _
ServerName:="MyServer", _
ServerUserName:="MyUserID", _
ServerPassword:="MyPassword", _
PackageName:="DTSDemo")
dtsp.Execute()
Christy Warner
www.autoaudit.com
"Alien2_51" wrote:
> There's a couple ways you could do this...
> Using parameters:
> http://www.sqldts.com/default.aspx?234
> DTS in VB.Net
> http://www.sqldts.com/default.aspx?265
> There's tons of DTS info on this site...
>
> "bagman3rd" wrote:
>

No comments:

Post a Comment