forked from Arvindpoongothai/SQLDBAInventory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path15-List Of All SSIS Packages In MSDB Database
55 lines (51 loc) · 1.95 KB
/
15-List Of All SSIS Packages In MSDB Database
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--List Of All SSIS Packages In MSDB Database
--This code will list all SSIS packages in stored in MSDB database for SQL Server 2005, 2008 and 2012
/*
SELECT @@version
SELECT *
FROM msdb.dbo.sysssispackages
SELECT *
FROM msdb.dbo.sysssispackagefolders
*/
IF @@version LIKE '%SQL Server 2005%'
SELECT a.name AS PackageName ,
a.[description] AS [Description] ,
b.foldername AS FolderName ,
CASE a.packagetype
WHEN 0 THEN 'Default client'
WHEN 1 THEN 'I/O Wizard'
WHEN 2 THEN 'DTS Designer'
WHEN 3 THEN 'Replication'
WHEN 5 THEN 'SSIS Designer'
WHEN 6 THEN 'Maintenance Plan'
ELSE 'Unknown'
END AS PackageTye ,
c.name AS OwnerName ,
a.createdate AS CreateDate ,
DATALENGTH(a.packagedata) AS PackageSize
FROM msdb.dbo.sysdtspackages90 AS a --SQL 2005
INNER JOIN msdb.dbo.sysdtspackagefolders90 AS b --SQL 2005
ON a.folderid = b.folderid
INNER JOIN sys.syslogins AS c ON a.ownersid = c.sid
ORDER BY a.name
ELSE
SELECT a.name AS PackageName ,
a.[description] AS [Description] ,
b.foldername AS FolderName ,
CASE a.packagetype
WHEN 0 THEN 'Default client'
WHEN 1 THEN 'I/O Wizard'
WHEN 2 THEN 'DTS Designer'
WHEN 3 THEN 'Replication'
WHEN 5 THEN 'SSIS Designer'
WHEN 6 THEN 'Maintenance Plan'
ELSE 'Unknown'
END AS PackageTye ,
c.name AS OwnerName ,
a.createdate AS CreateDate ,
DATALENGTH(a.packagedata) AS PackageSize
FROM msdb.dbo.sysssispackages AS a --SQL 2008
INNER JOIN msdb.dbo.sysssispackagefolders AS b --SQL 2008
ON a.folderid = b.folderid
INNER JOIN sys.syslogins AS c ON a.ownersid = c.sid
ORDER BY a.name