dbTalk Databases Forums  

DTS: How to call a sub-package by name only?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS: How to call a sub-package by name only? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Peterson
 
Posts: n/a

Default DTS: How to call a sub-package by name only? - 06-07-2004 , 08:58 AM






(SQL Server 2000, SP3a)

Hello all!

I've got a package that has several "Execute Package Task" elements. I'd like to make the
sub-packages version-independent. I ran across this blurb:

http://www.sqldts.com/default.aspx?216

Which talks about blanking the PackageID. I've done exactly as this has described (both
by blanking the PackageID with "Disconnected Edit" *and* by having a blank Global Variable
that I set the PackageIDs to). However, when I invoke my outer package, I keep getting an
"invalid GUID".

Any help would be greatly appreciated. Thanks!

John Peterson



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How to call a sub-package by name only? - 06-07-2004 , 09:27 AM






You could of course simply use an Active Script task and call the package
that way OR an ExecuteProcess task with DTSRUN.

I have just followed the article and it works for me.


--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote

Quote:
(SQL Server 2000, SP3a)

Hello all!

I've got a package that has several "Execute Package Task" elements. I'd
like to make the
sub-packages version-independent. I ran across this blurb:

http://www.sqldts.com/default.aspx?216

Which talks about blanking the PackageID. I've done exactly as this has
described (both
by blanking the PackageID with "Disconnected Edit" *and* by having a blank
Global Variable
that I set the PackageIDs to). However, when I invoke my outer package, I
keep getting an
"invalid GUID".

Any help would be greatly appreciated. Thanks!

John Peterson





Reply With Quote
  #3  
Old   
John Peterson
 
Posts: n/a

Default Re: How to call a sub-package by name only? - 06-07-2004 , 09:48 AM



Thanks Allan!

I *think* I might be having some issues with the blank global variable being "<not
displayable>". That is, when I use the Global Variable editor to "blank" out my PackageID
GV, everything works. However, if I save my package (as Structured Storage), exit the
package, and re-run it, I consistently get the "Invalid GUID specified" error. If I edit
the PackageID GV to blank it out again, then it works.

I even added a ActiveX task to set the PackageID GV:

' Ensure that the PackageID global variable is blank.
DTSGlobalVariables("PackageID").Value = ""

But upon initial load of the package, it still fails until I manually "dink" that GV.

If you have the time and inclination, could you try that and let me know of your results?

Many regards,

John Peterson



"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
You could of course simply use an Active Script task and call the package
that way OR an ExecuteProcess task with DTSRUN.

I have just followed the article and it works for me.


--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:ObapPeJTEHA.3768 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
(SQL Server 2000, SP3a)

Hello all!

I've got a package that has several "Execute Package Task" elements. I'd
like to make the
sub-packages version-independent. I ran across this blurb:

http://www.sqldts.com/default.aspx?216

Which talks about blanking the PackageID. I've done exactly as this has
described (both
by blanking the PackageID with "Disconnected Edit" *and* by having a blank
Global Variable
that I set the PackageIDs to). However, when I invoke my outer package, I
keep getting an
"invalid GUID".

Any help would be greatly appreciated. Thanks!

John Peterson







Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How to call a sub-package by name only? - 06-08-2004 , 03:12 AM



What I think then is happening is that you are saying "" which is not empty.

Why do you have a GV setting the Package GUID in the first place if you do
not want to use it?

I would remove this altogether or if you want to occasionally specify the
GUID and sometimes not then I would do it in an Active Script task where i
could decide to use/or not based on a certain condition

--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote

Quote:
Thanks Allan!

I *think* I might be having some issues with the blank global variable
being "<not
displayable>". That is, when I use the Global Variable editor to "blank"
out my PackageID
GV, everything works. However, if I save my package (as Structured
Storage), exit the
package, and re-run it, I consistently get the "Invalid GUID specified"
error. If I edit
the PackageID GV to blank it out again, then it works.

I even added a ActiveX task to set the PackageID GV:

' Ensure that the PackageID global variable is blank.
DTSGlobalVariables("PackageID").Value = ""

But upon initial load of the package, it still fails until I manually
"dink" that GV.

If you have the time and inclination, could you try that and let me know
of your results?

Many regards,

John Peterson



"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:eUuOQuJTEHA.2128 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
You could of course simply use an Active Script task and call the
package
that way OR an ExecuteProcess task with DTSRUN.

I have just followed the article and it works for me.


--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:ObapPeJTEHA.3768 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
(SQL Server 2000, SP3a)

Hello all!

I've got a package that has several "Execute Package Task" elements.
I'd
like to make the
sub-packages version-independent. I ran across this blurb:

http://www.sqldts.com/default.aspx?216

Which talks about blanking the PackageID. I've done exactly as this
has
described (both
by blanking the PackageID with "Disconnected Edit" *and* by having a
blank
Global Variable
that I set the PackageIDs to). However, when I invoke my outer
package, I
keep getting an
"invalid GUID".

Any help would be greatly appreciated. Thanks!

John Peterson









Reply With Quote
  #5  
Old   
John Peterson
 
Posts: n/a

Default Re: How to call a sub-package by name only? - 06-08-2004 , 08:20 AM



Sorry, I should have been more clear: I *always* want to call the sub-package by name
only, so I *do* want to use the GV to set the PackageID. The problem is, it seems like
DTS is sometimes replacing the actual string of "<not displayable>" for the PackageID when
I first load the package, which will then generate the "Invalid GUID specified" error. It
seems like I need to manually clear out the GV the first time I run it in the designer.


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
What I think then is happening is that you are saying "" which is not empty.

Why do you have a GV setting the Package GUID in the first place if you do
not want to use it?

I would remove this altogether or if you want to occasionally specify the
GUID and sometimes not then I would do it in an Active Script task where i
could decide to use/or not based on a certain condition

--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:OsbAS6JTEHA.3548 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Thanks Allan!

I *think* I might be having some issues with the blank global variable
being "<not
displayable>". That is, when I use the Global Variable editor to "blank"
out my PackageID
GV, everything works. However, if I save my package (as Structured
Storage), exit the
package, and re-run it, I consistently get the "Invalid GUID specified"
error. If I edit
the PackageID GV to blank it out again, then it works.

I even added a ActiveX task to set the PackageID GV:

' Ensure that the PackageID global variable is blank.
DTSGlobalVariables("PackageID").Value = ""

But upon initial load of the package, it still fails until I manually
"dink" that GV.

If you have the time and inclination, could you try that and let me know
of your results?

Many regards,

John Peterson



"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:eUuOQuJTEHA.2128 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
You could of course simply use an Active Script task and call the
package
that way OR an ExecuteProcess task with DTSRUN.

I have just followed the article and it works for me.


--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:ObapPeJTEHA.3768 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
(SQL Server 2000, SP3a)

Hello all!

I've got a package that has several "Execute Package Task" elements.
I'd
like to make the
sub-packages version-independent. I ran across this blurb:

http://www.sqldts.com/default.aspx?216

Which talks about blanking the PackageID. I've done exactly as this
has
described (both
by blanking the PackageID with "Disconnected Edit" *and* by having a
blank
Global Variable
that I set the PackageIDs to). However, when I invoke my outer
package, I
keep getting an
"invalid GUID".

Any help would be greatly appreciated. Thanks!

John Peterson











Reply With Quote
  #6  
Old   
Phill Carter
 
Posts: n/a

Default Re: How to call a sub-package by name only? - 06-08-2004 , 06:00 PM



John

If you never want to load the DTS package using either the Package and
Version GUID, then I'd do as Allan has suggested and put either,
a) Blank out the GUIDs using disconnected edit. They will only come back if
you edit that task in the designer.
b) Write a short ActiveScript task to blank out the GUIDs at the start of
the package.
Here is a script I use to accomplish that,

<----- Start ----->
Dim oPkg
Dim colTasks
Dim sTsk

' open DTS package object so we can get the package details
Set oPkg = DTSGlobalVariables.Parent

' open object referring to Tasks collection
Set colTasks = oPkg.Tasks

' for each item in the collection
For Each sTsk in colTasks

' check if the task is an Execute Package task
If InStr(1, sTsk.Name, "DTSExecutePackageTask", vbTextCompare ) > 0 Then
' create object referring to selected task
Set oTsk = oPkg.Tasks(sTsk.Name)

' blank out Package and VersionIDs so package loads by name only
' this will ensure that only the latest version is loaded.
oTsk.Properties("PackageID").Value = ""
oTsk.Properties("VersionID").Value = ""

' release object that was created
Set oTsk = Nothing

End If

Next

Set colTasks = Nothing
Set oPkg = Nothing

<----- End ----->

----------------------
Thanks
Phill


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote

Quote:
Sorry, I should have been more clear: I *always* want to call the
sub-package by name
only, so I *do* want to use the GV to set the PackageID. The problem is,
it seems like
DTS is sometimes replacing the actual string of "<not displayable>" for
the PackageID when
I first load the package, which will then generate the "Invalid GUID
specified" error. It
seems like I need to manually clear out the GV the first time I run it in
the designer.


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:uMVOqBTTEHA.1732 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
What I think then is happening is that you are saying "" which is not
empty.

Why do you have a GV setting the Package GUID in the first place if you
do
not want to use it?

I would remove this altogether or if you want to occasionally specify
the
GUID and sometimes not then I would do it in an Active Script task where
i
could decide to use/or not based on a certain condition

--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:OsbAS6JTEHA.3548 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Thanks Allan!

I *think* I might be having some issues with the blank global variable
being "<not
displayable>". That is, when I use the Global Variable editor to
"blank"
out my PackageID
GV, everything works. However, if I save my package (as Structured
Storage), exit the
package, and re-run it, I consistently get the "Invalid GUID
specified"
error. If I edit
the PackageID GV to blank it out again, then it works.

I even added a ActiveX task to set the PackageID GV:

' Ensure that the PackageID global variable is blank.
DTSGlobalVariables("PackageID").Value = ""

But upon initial load of the package, it still fails until I manually
"dink" that GV.

If you have the time and inclination, could you try that and let me
know
of your results?

Many regards,

John Peterson



"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:eUuOQuJTEHA.2128 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
You could of course simply use an Active Script task and call the
package
that way OR an ExecuteProcess task with DTSRUN.

I have just followed the article and it works for me.


--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:ObapPeJTEHA.3768 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
(SQL Server 2000, SP3a)

Hello all!

I've got a package that has several "Execute Package Task"
elements.
I'd
like to make the
sub-packages version-independent. I ran across this blurb:

http://www.sqldts.com/default.aspx?216

Which talks about blanking the PackageID. I've done exactly as
this
has
described (both
by blanking the PackageID with "Disconnected Edit" *and* by having
a
blank
Global Variable
that I set the PackageIDs to). However, when I invoke my outer
package, I
keep getting an
"invalid GUID".

Any help would be greatly appreciated. Thanks!

John Peterson













Reply With Quote
  #7  
Old   
John Peterson
 
Posts: n/a

Default Re: How to call a sub-package by name only? - 06-08-2004 , 11:41 PM



Thanks Phil!

Ah -- I thought I might need to constantly set the PackageID to blank (hence the global
variable approach). But it sounds like I really only need to do this *once* with the
Disconnected Edit feature (unless I edit the task again, of course).

Thanks for the sample script!

John Peterson



"Phill Carter" <pcarter (AT) no-spam (DOT) bellpotter.com.au> wrote

Quote:
John

If you never want to load the DTS package using either the Package and
Version GUID, then I'd do as Allan has suggested and put either,
a) Blank out the GUIDs using disconnected edit. They will only come back if
you edit that task in the designer.
b) Write a short ActiveScript task to blank out the GUIDs at the start of
the package.
Here is a script I use to accomplish that,

----- Start -----
Dim oPkg
Dim colTasks
Dim sTsk

' open DTS package object so we can get the package details
Set oPkg = DTSGlobalVariables.Parent

' open object referring to Tasks collection
Set colTasks = oPkg.Tasks

' for each item in the collection
For Each sTsk in colTasks

' check if the task is an Execute Package task
If InStr(1, sTsk.Name, "DTSExecutePackageTask", vbTextCompare ) > 0 Then
' create object referring to selected task
Set oTsk = oPkg.Tasks(sTsk.Name)

' blank out Package and VersionIDs so package loads by name only
' this will ensure that only the latest version is loaded.
oTsk.Properties("PackageID").Value = ""
oTsk.Properties("VersionID").Value = ""

' release object that was created
Set oTsk = Nothing

End If

Next

Set colTasks = Nothing
Set oPkg = Nothing

----- End -----

----------------------
Thanks
Phill


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:urAJ4tVTEHA.3548 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Sorry, I should have been more clear: I *always* want to call the
sub-package by name
only, so I *do* want to use the GV to set the PackageID. The problem is,
it seems like
DTS is sometimes replacing the actual string of "<not displayable>" for
the PackageID when
I first load the package, which will then generate the "Invalid GUID
specified" error. It
seems like I need to manually clear out the GV the first time I run it in
the designer.


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:uMVOqBTTEHA.1732 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
What I think then is happening is that you are saying "" which is not
empty.

Why do you have a GV setting the Package GUID in the first place if you
do
not want to use it?

I would remove this altogether or if you want to occasionally specify
the
GUID and sometimes not then I would do it in an Active Script task where
i
could decide to use/or not based on a certain condition

--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:OsbAS6JTEHA.3548 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Thanks Allan!

I *think* I might be having some issues with the blank global variable
being "<not
displayable>". That is, when I use the Global Variable editor to
"blank"
out my PackageID
GV, everything works. However, if I save my package (as Structured
Storage), exit the
package, and re-run it, I consistently get the "Invalid GUID
specified"
error. If I edit
the PackageID GV to blank it out again, then it works.

I even added a ActiveX task to set the PackageID GV:

' Ensure that the PackageID global variable is blank.
DTSGlobalVariables("PackageID").Value = ""

But upon initial load of the package, it still fails until I manually
"dink" that GV.

If you have the time and inclination, could you try that and let me
know
of your results?

Many regards,

John Peterson



"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:eUuOQuJTEHA.2128 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
You could of course simply use an Active Script task and call the
package
that way OR an ExecuteProcess task with DTSRUN.

I have just followed the article and it works for me.


--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:ObapPeJTEHA.3768 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
(SQL Server 2000, SP3a)

Hello all!

I've got a package that has several "Execute Package Task"
elements.
I'd
like to make the
sub-packages version-independent. I ran across this blurb:

http://www.sqldts.com/default.aspx?216

Which talks about blanking the PackageID. I've done exactly as
this
has
described (both
by blanking the PackageID with "Disconnected Edit" *and* by having
a
blank
Global Variable
that I set the PackageIDs to). However, when I invoke my outer
package, I
keep getting an
"invalid GUID".

Any help would be greatly appreciated. Thanks!

John Peterson















Reply With Quote
  #8  
Old   
Darren Green
 
Posts: n/a

Default Re: How to call a sub-package by name only? - 06-09-2004 , 03:55 AM



"...then you can remove the dependency on the PackageID, by blanking out the
PackageID property of the ExecutePackageTask.... This can be done as a
one-off exercise with the Disconnected Edit feature..."

"If you regularly migrate packages and do not want to have to worry about
this, you can add a Dynamic Properties task to perform this during package
run-time..."

Is it not clear that you do this once, unless you change things?


--
Darren Green
http://www.sqldts.com


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote

Quote:
Thanks Phil!

Ah -- I thought I might need to constantly set the PackageID to blank
(hence the global
variable approach). But it sounds like I really only need to do this
*once* with the
Disconnected Edit feature (unless I edit the task again, of course).

Thanks for the sample script!

John Peterson



"Phill Carter" <pcarter (AT) no-spam (DOT) bellpotter.com.au> wrote in message
news:edtCtxaTEHA.204 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
John

If you never want to load the DTS package using either the Package and
Version GUID, then I'd do as Allan has suggested and put either,
a) Blank out the GUIDs using disconnected edit. They will only come back
if
you edit that task in the designer.
b) Write a short ActiveScript task to blank out the GUIDs at the start
of
the package.
Here is a script I use to accomplish that,

----- Start -----
Dim oPkg
Dim colTasks
Dim sTsk

' open DTS package object so we can get the package details
Set oPkg = DTSGlobalVariables.Parent

' open object referring to Tasks collection
Set colTasks = oPkg.Tasks

' for each item in the collection
For Each sTsk in colTasks

' check if the task is an Execute Package task
If InStr(1, sTsk.Name, "DTSExecutePackageTask", vbTextCompare ) > 0
Then
' create object referring to selected task
Set oTsk = oPkg.Tasks(sTsk.Name)

' blank out Package and VersionIDs so package loads by name only
' this will ensure that only the latest version is loaded.
oTsk.Properties("PackageID").Value = ""
oTsk.Properties("VersionID").Value = ""

' release object that was created
Set oTsk = Nothing

End If

Next

Set colTasks = Nothing
Set oPkg = Nothing

----- End -----

----------------------
Thanks
Phill


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:urAJ4tVTEHA.3548 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Sorry, I should have been more clear: I *always* want to call the
sub-package by name
only, so I *do* want to use the GV to set the PackageID. The problem
is,
it seems like
DTS is sometimes replacing the actual string of "<not displayable>"
for
the PackageID when
I first load the package, which will then generate the "Invalid GUID
specified" error. It
seems like I need to manually clear out the GV the first time I run it
in
the designer.


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:uMVOqBTTEHA.1732 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
What I think then is happening is that you are saying "" which is
not
empty.

Why do you have a GV setting the Package GUID in the first place if
you
do
not want to use it?

I would remove this altogether or if you want to occasionally
specify
the
GUID and sometimes not then I would do it in an Active Script task
where
i
could decide to use/or not based on a certain condition

--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:OsbAS6JTEHA.3548 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Thanks Allan!

I *think* I might be having some issues with the blank global
variable
being "<not
displayable>". That is, when I use the Global Variable editor to
"blank"
out my PackageID
GV, everything works. However, if I save my package (as
Structured
Storage), exit the
package, and re-run it, I consistently get the "Invalid GUID
specified"
error. If I edit
the PackageID GV to blank it out again, then it works.

I even added a ActiveX task to set the PackageID GV:

' Ensure that the PackageID global variable is blank.
DTSGlobalVariables("PackageID").Value = ""

But upon initial load of the package, it still fails until I
manually
"dink" that GV.

If you have the time and inclination, could you try that and let
me
know
of your results?

Many regards,

John Peterson



"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:eUuOQuJTEHA.2128 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
You could of course simply use an Active Script task and call
the
package
that way OR an ExecuteProcess task with DTSRUN.

I have just followed the article and it works for me.


--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:ObapPeJTEHA.3768 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
(SQL Server 2000, SP3a)

Hello all!

I've got a package that has several "Execute Package Task"
elements.
I'd
like to make the
sub-packages version-independent. I ran across this blurb:

http://www.sqldts.com/default.aspx?216

Which talks about blanking the PackageID. I've done exactly
as
this
has
described (both
by blanking the PackageID with "Disconnected Edit" *and* by
having
a
blank
Global Variable
that I set the PackageIDs to). However, when I invoke my
outer
package, I
keep getting an
"invalid GUID".

Any help would be greatly appreciated. Thanks!

John Peterson

















Reply With Quote
  #9  
Old   
John Peterson
 
Posts: n/a

Default Re: How to call a sub-package by name only? - 06-09-2004 , 06:24 PM



"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
"...then you can remove the dependency on the PackageID, by blanking out the
PackageID property of the ExecutePackageTask.... This can be done as a
one-off exercise with the Disconnected Edit feature..."

"If you regularly migrate packages and do not want to have to worry about
this, you can add a Dynamic Properties task to perform this during package
run-time..."

Is it not clear that you do this once, unless you change things?
It wasn't clear to me. Does "migrate packages" mean change them? Or move them from place
to place? Or how do I interpret that?


Quote:
--
Darren Green
http://www.sqldts.com


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:e9rLYwdTEHA.1172 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Thanks Phil!

Ah -- I thought I might need to constantly set the PackageID to blank
(hence the global
variable approach). But it sounds like I really only need to do this
*once* with the
Disconnected Edit feature (unless I edit the task again, of course).

Thanks for the sample script!

John Peterson



"Phill Carter" <pcarter (AT) no-spam (DOT) bellpotter.com.au> wrote in message
news:edtCtxaTEHA.204 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
John

If you never want to load the DTS package using either the Package and
Version GUID, then I'd do as Allan has suggested and put either,
a) Blank out the GUIDs using disconnected edit. They will only come back
if
you edit that task in the designer.
b) Write a short ActiveScript task to blank out the GUIDs at the start
of
the package.
Here is a script I use to accomplish that,

----- Start -----
Dim oPkg
Dim colTasks
Dim sTsk

' open DTS package object so we can get the package details
Set oPkg = DTSGlobalVariables.Parent

' open object referring to Tasks collection
Set colTasks = oPkg.Tasks

' for each item in the collection
For Each sTsk in colTasks

' check if the task is an Execute Package task
If InStr(1, sTsk.Name, "DTSExecutePackageTask", vbTextCompare ) > 0
Then
' create object referring to selected task
Set oTsk = oPkg.Tasks(sTsk.Name)

' blank out Package and VersionIDs so package loads by name only
' this will ensure that only the latest version is loaded.
oTsk.Properties("PackageID").Value = ""
oTsk.Properties("VersionID").Value = ""

' release object that was created
Set oTsk = Nothing

End If

Next

Set colTasks = Nothing
Set oPkg = Nothing

----- End -----

----------------------
Thanks
Phill


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:urAJ4tVTEHA.3548 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Sorry, I should have been more clear: I *always* want to call the
sub-package by name
only, so I *do* want to use the GV to set the PackageID. The problem
is,
it seems like
DTS is sometimes replacing the actual string of "<not displayable>"
for
the PackageID when
I first load the package, which will then generate the "Invalid GUID
specified" error. It
seems like I need to manually clear out the GV the first time I run it
in
the designer.


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:uMVOqBTTEHA.1732 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
What I think then is happening is that you are saying "" which is
not
empty.

Why do you have a GV setting the Package GUID in the first place if
you
do
not want to use it?

I would remove this altogether or if you want to occasionally
specify
the
GUID and sometimes not then I would do it in an Active Script task
where
i
could decide to use/or not based on a certain condition

--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:OsbAS6JTEHA.3548 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Thanks Allan!

I *think* I might be having some issues with the blank global
variable
being "<not
displayable>". That is, when I use the Global Variable editor to
"blank"
out my PackageID
GV, everything works. However, if I save my package (as
Structured
Storage), exit the
package, and re-run it, I consistently get the "Invalid GUID
specified"
error. If I edit
the PackageID GV to blank it out again, then it works.

I even added a ActiveX task to set the PackageID GV:

' Ensure that the PackageID global variable is blank.
DTSGlobalVariables("PackageID").Value = ""

But upon initial load of the package, it still fails until I
manually
"dink" that GV.

If you have the time and inclination, could you try that and let
me
know
of your results?

Many regards,

John Peterson



"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:eUuOQuJTEHA.2128 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
You could of course simply use an Active Script task and call
the
package
that way OR an ExecuteProcess task with DTSRUN.

I have just followed the article and it works for me.


--

----------------------------

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


"John Peterson" <j0hnp (AT) comcast (DOT) net> wrote in message
news:ObapPeJTEHA.3768 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
(SQL Server 2000, SP3a)

Hello all!

I've got a package that has several "Execute Package Task"
elements.
I'd
like to make the
sub-packages version-independent. I ran across this blurb:

http://www.sqldts.com/default.aspx?216

Which talks about blanking the PackageID. I've done exactly
as
this
has
described (both
by blanking the PackageID with "Disconnected Edit" *and* by
having
a
blank
Global Variable
that I set the PackageIDs to). However, when I invoke my
outer
package, I
keep getting an
"invalid GUID".

Any help would be greatly appreciated. Thanks!

John Peterson



















Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.