dbTalk Databases Forums  

How do I determine if DTS Package exists on Server?

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


Discuss How do I determine if DTS Package exists on Server? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joseph Geretz
 
Posts: n/a

Default How do I determine if DTS Package exists on Server? - 03-18-2005 , 09:46 AM






How do I determine whether or not a specific DTS Package (I know the name of
the package) exists on the Server?

Thanks for your help,

- Joe Geretz -



Reply With Quote
  #2  
Old   
Francesco Anti
 
Posts: n/a

Default Re: How do I determine if DTS Package exists on Server? - 03-18-2005 , 09:58 AM






Select * from msdb.dbo.sysdtspackages where name='packageName'

Francesco Anti


"Joseph Geretz" <jgeretz (AT) nospam (DOT) com> wrote

Quote:
How do I determine whether or not a specific DTS Package (I know the name
of the package) exists on the Server?

Thanks for your help,

- Joe Geretz -




Reply With Quote
  #3  
Old   
Simon Worth
 
Posts: n/a

Default Re: How do I determine if DTS Package exists on Server? - 03-18-2005 , 10:02 AM



Open the Data Transformation Services folder in EM, and check within
"Local Packages" and "Meta Data Services" packages.
A DTS Package can also be saved as a structured storage file on the hard
disk.

You can also query msdb
USE msdb
GO

SELECT DISTINCT
Name
FROM
sysdtspackages
ORDER BY
Name

Simon Worth

Joseph Geretz wrote:
Quote:
How do I determine whether or not a specific DTS Package (I know the name of
the package) exists on the Server?

Thanks for your help,

- Joe Geretz -



Reply With Quote
  #4  
Old   
Joseph Geretz
 
Posts: n/a

Default Re: How do I determine if DTS Package exists on Server? - 03-18-2005 , 10:46 AM



Thanks Francesco and Simon for your help.

I actually opted for a third approach, using the DTS object model. I'm
posting the code below, perhaps others will find this useful.

- Joe Geretz -

Public Function PackageExists(DBConnect As String, Package As String) As
Boolean

Dim SQLServer As String
Dim SQLUID As String
Dim SQLPWD As String
Dim DTSPkg As DTS.Package2

On Error GoTo ErrHandle

Set DTSPkg = New DTS.Package2

zGetDBCredentials DBConnect, SQLServer, SQLUID, SQLPWD

DTSPkg.LoadFromSQLServer SQLServer, _
SQLUID, _
SQLPWD, _
, _
, _
, _
, _
Package

PackageExists = True

Exit Function

ErrHandle:

PackageExists = False

End Function

"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote

Quote:
Open the Data Transformation Services folder in EM, and check within
"Local Packages" and "Meta Data Services" packages.
A DTS Package can also be saved as a structured storage file on the hard
disk.

You can also query msdb
USE msdb
GO

SELECT DISTINCT
Name
FROM
sysdtspackages
ORDER BY
Name

Simon Worth

Joseph Geretz wrote:
How do I determine whether or not a specific DTS Package (I know the name
of the package) exists on the Server?

Thanks for your help,

- Joe Geretz -



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

Default Re: How do I determine if DTS Package exists on Server? - 03-18-2005 , 04:37 PM



I think loading a package just to check if it exists is not a good idea.
If you insist on using the object model then lookup the EnumPackageInfos
method in Books Online, although I would stick with the sysdtspackages
query myself. Simple, fast and does the job.


In message <O73iYo9KFHA.4052 (AT) tk2msftngp13 (DOT) phx.gbl>, Joseph Geretz
<jgeretz (AT) nospam (DOT) com> writes
Quote:
Thanks Francesco and Simon for your help.

I actually opted for a third approach, using the DTS object model. I'm
posting the code below, perhaps others will find this useful.

- Joe Geretz -

Public Function PackageExists(DBConnect As String, Package As String) As
Boolean

Dim SQLServer As String
Dim SQLUID As String
Dim SQLPWD As String
Dim DTSPkg As DTS.Package2

On Error GoTo ErrHandle

Set DTSPkg = New DTS.Package2

zGetDBCredentials DBConnect, SQLServer, SQLUID, SQLPWD

DTSPkg.LoadFromSQLServer SQLServer, _
SQLUID, _
SQLPWD, _
, _
, _
, _
, _
Package

PackageExists = True

Exit Function

ErrHandle:

PackageExists = False

End Function

"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote in message
news:uDG3zP9KFHA.1176 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Open the Data Transformation Services folder in EM, and check within
"Local Packages" and "Meta Data Services" packages.
A DTS Package can also be saved as a structured storage file on the hard
disk.

You can also query msdb
USE msdb
GO

SELECT DISTINCT
Name
FROM
sysdtspackages
ORDER BY
Name

Simon Worth

Joseph Geretz wrote:
How do I determine whether or not a specific DTS Package (I know the name
of the package) exists on the Server?

Thanks for your help,

- Joe Geretz -


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.