![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have seen the example on http://www.sqldts.com, but would like more clarification. Please show how to connect to a DTS package on the server and then change the connection path and file name of the excel file that contains the data to be loaded into the table. I am not getting how the Global Variable stuff works. Is there an object list to the DTS package as well? I am using vbscript. Can this be done using dtsrun.exe. Thanks! Please post answer to group. |
#3
| |||
| |||
|
|
In message <2f691c82.0402170905.69e61e76 (AT) posting (DOT) google.com>, Paul Muller <muller.paul (AT) principal (DOT) com> writes I have seen the example on http://www.sqldts.com, but would like more clarification. Please show how to connect to a DTS package on the server and then change the connection path and file name of the excel file that contains the data to be loaded into the table. I am not getting how the Global Variable stuff works. Is there an object list to the DTS package as well? I am using vbscript. Can this be done using dtsrun.exe. Thanks! Please post answer to group. The object model is documented in Books Online. One way of coping with changing paths and other parameters is to design the package such that it reads these properties at run-time from an external source. The simplest way to do this is with a Dynamic Properties Task. Sometimes this task can be a bit limited so you resort to script, but the principle is the same. Global variables are often used a half-way house for this information. I would not recommend you make changes to the package when ever something in your environment changes, rather design the package so that it refreshes the information at run-time. As above the package can read from an external source, or depending on your execution method you can pass values in as part of that. If executing through the object model then you can set task properties or global variables before calling the execute method. If using DTSRUN then look at the /A parameter as a neat way of setting a global variable. The package must be designed to use the global variable of course. I personally combine the DTSRUN /A with reading from an external source for my packages. For every package I schedule I always pass in a server name. I assume SQL security since all my scheduled execute on a SQL Server box, and all of them have a common DB with a table containing environment specific settings. Every package then uses the server (DTSRUN set global variable) to lookup what that specific package requires in by common DB table. Any help? |
#4
| |||
| |||
|
|
Question when I send a bogus path name to the package -a "FilePath":"8"="f:\Package_TST.xls", sometimes it works and sometimes it does not. I would expect it to fail every time? |
#5
| |||
| |||
|
|
"Sending" the path is just setting a global variable, so that in itself will not fail since it is just passing through a string. If the package is setup to read the global variable as a path and use it then I would expect it to always fail when you pass an invalid path. If it doesn't then check you are setting the correct global variable, note names are case sensitive, and that you are actually using it every time.For it to inconsistent there must be some inconsistency in the way you are using the variable in the package. -- Darren Green http://www.sqldts.com "Paul Muller" <muller.paul (AT) principal (DOT) com> wrote in message news:2f691c82.0402180656.47af8ab4 (AT) posting (DOT) google.com... snip Question when I send a bogus path name to the package -a "FilePath":"8"="f:\Package_TST.xls", sometimes it works and sometimes it does not. I would expect it to fail every time? |
#6
| |||
| |||
|
|
When I put the bogus path the default file path still existed, is it possible that if it did not find the passed in path it the defaults to the default path? From a variable level no. From a connection level no. |
|
path the file failed consistently, when I passed the bogus path. Is it possible to remove the default path and connection so it for sure always read the -a switch? No. You remove the variable value by ovewriting it witha another. Based on |
|
Thanks so much! "Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message news:<#rhDAjj9DHA.2416 (AT) TK2MSFTNGP10 (DOT) phx.gbl>... "Sending" the path is just setting a global variable, so that in itself will not fail since it is just passing through a string. If the package is setup to read the global variable as a path and use it then I would expect it to always fail when you pass an invalid path. If it doesn't then check you are setting the correct global variable, note names are case sensitive, and that you are actually using it every time.For it to inconsistent there must be some inconsistency in the way you are using the variable in the package. -- Darren Green http://www.sqldts.com "Paul Muller" <muller.paul (AT) principal (DOT) com> wrote in message news:2f691c82.0402180656.47af8ab4 (AT) posting (DOT) google.com... snip Question when I send a bogus path name to the package -a "FilePath":"8"="f:\Package_TST.xls", sometimes it works and sometimes it does not. I would expect it to fail every time? |
![]() |
| Thread Tools | |
| Display Modes | |
| |