![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello everyone, I'm using the following DTS package to extract table contents into a .txt based list file. select o.name from Object o,viewhierarchy v where parentobjid = 3829 and o.objid = v.objid My intent is to script this operation using DTSRUN and then to take advantage of the /A option to supply dynamic values and replace the 3829 value in my above example. Could anyone provide me with a little assistance in how I would modify this package to reflect the values assigned with DTSRUN? I've got just enough knowledge to be dangerous here, so any help would be greatly appreciated! Thanks, Mark |
#3
| |||
| |||
|
|
Thanks, Darren! That was of great help. One final question, though. As I stated previously, I am using the query listed in my original post to perform a select statement based upon a particular value, which in this case is the column value of ParentObjID and the row value of 3829. This query also allows me to select multiple row values if I modify the query to appear as such: select o.name from Object o,viewhierarchy v where parentobjid in (3829,26080,23919) and o.objid = v.objid Is there a way to set up a global variable so that it can pass multiple values similar to an array like this? I tried using the existing string variable to pass the value of "3829,26080,23919" to the package, but it did not return any information. Any ideas? Thanks, Mark |
#4
| |||
| |||
|
|
-----Original Message----- In article <024c01c37c84$f4e2fdf0$a401280a (AT) phx (DOT) gbl>, Mark Todd mtodd (AT) veritas (DOT) com> writes Hello everyone, I'm using the following DTS package to extract table contents into a .txt based list file. select o.name from Object o,viewhierarchy v where parentobjid = 3829 and o.objid = v.objid My intent is to script this operation using DTSRUN and then to take advantage of the /A option to supply dynamic values and replace the 3829 value in my above example. Could anyone provide me with a little assistance in how I would modify this package to reflect the values assigned with DTSRUN? I've got just enough knowledge to be dangerous here, so any help would be greatly appreciated! Thanks, Mark First create a global variable in your package to hold the parentobjid value. String type will be fine. Enter any value for now. In the task, replace the 3829 with ? and click Parameters, and then map the first (only) parameter to your global variable. You can now change the global variable and this will be reflected in the query. Using /A to change the value gives you the next link for automating the process as you know. -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org . |
#5
| |||
| |||
|
|
-----Original Message----- In article <024c01c37c84$f4e2fdf0$a401280a (AT) phx (DOT) gbl>, Mark Todd mtodd (AT) veritas (DOT) com> writes Hello everyone, I'm using the following DTS package to extract table contents into a .txt based list file. select o.name from Object o,viewhierarchy v where parentobjid = 3829 and o.objid = v.objid My intent is to script this operation using DTSRUN and then to take advantage of the /A option to supply dynamic values and replace the 3829 value in my above example. Could anyone provide me with a little assistance in how I would modify this package to reflect the values assigned with DTSRUN? I've got just enough knowledge to be dangerous here, so any help would be greatly appreciated! Thanks, Mark First create a global variable in your package to hold the parentobjid value. String type will be fine. Enter any value for now. In the task, replace the 3829 with ? and click Parameters, and then map the first (only) parameter to your global variable. You can now change the global variable and this will be reflected in the query. Using /A to change the value gives you the next link for automating the process as you know. -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org . Thanks, Darren. I've got one more question, though. As stated in the query above, I am returning values from a single column value and it works. However, I have a variant of the above query that returns values for several column values which is included here: select o.name from Object o,viewhierarchy v where parentobjid in (11996,11740,13677,3828,11737,11738,11739,11236,11 741,11742 ,11239) and o.objid = v.objid Trying to replicate this with the DTSRUN command, I tried to use the following: dtsrun /s svlniq02 /e /n test2 /a ParentFolder=26080,21232 When I try to run this, I get this error: Error: -2147217904 (80040E10); Provider Error: 0 (0) Error string: No value given for one or more required parameters. Error source: Microsoft OLE DB Provider for SQL Server Help file: Help context: 0 Any idea how I would pass multiple values here? Before you tell me to use multiple Global Variables, keep in mind that the number of entries would be different, and whenever I try to use multiple global variables with empty values, I get errors. Is there a way to do avoid this? Thanks, Mark |
![]() |
| Thread Tools | |
| Display Modes | |
| |