Skip to content

Commit 90b0a41

Browse files
New features
* Added restore_command in output list of versions for easy project version restore in SSISDB catalog.
1 parent b0dd1fd commit 90b0a41

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

SSISDB/sp_SSISExportProject.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ IF NOT EXISTS(SELECT * FROM sys.procedures WHERE object_id = OBJECT_ID('[dbo].[s
1717
EXEC (N'CREATE PROCEDURE [dbo].[sp_SSISExportProject] AS PRINT ''Placeholder for [dbo].[sp_SSISExportProject]''')
1818
GO
1919
/* ****************************************************
20-
sp_SSISExportProject v 0.10 (2019-10-13)
20+
sp_SSISExportProject v 0.20 (2020-10-12)
2121
2222
Feedback: mailto:pavel.pawlowski@hotmail.cz
2323
@@ -77,7 +77,7 @@ BEGIN
7777
,@help bit = 0
7878

7979

80-
RAISERROR(N'sp_SSISExportProject v0.10 (2019-10-13) (C) 2019 Pavel Pawlowski', 0, 0) WITH NOWAIT;
80+
RAISERROR(N'sp_SSISExportProject v0.20 (2020-10-12) (C) 2019 Pavel Pawlowski', 0, 0) WITH NOWAIT;
8181
RAISERROR(N'================================================================' , 0, 0) WITH NOWAIT;
8282
RAISERROR(N'sp_SSISExportProject extracts ssisdb project to .ispac file', 0, 0) WITH NOWAIT;
8383
RAISERROR(N'https://github.com/PavelPawlowski/SQL-Scripts', 0, 0) WITH NOWAIT;
@@ -117,6 +117,8 @@ Usage:
117117
Only @version or @version_date can be specified at a time.
118118
When no @version or @version date is specified then he current active version is exported.
119119
,@listVersion bit = 0 - When 1 then list of projects and versions is provided and no export is performed.
120+
When versions a relisted a command for exporting concrete version as well as command
121+
for eventual restoring of the version in SSISDB catalog is provided.
120122
,@create_path bit = 0 - Specifies whether the path portion of the destination file should be automatically created
121123
122124
', 0, 0) WITH NOWAIT;
@@ -139,6 +141,7 @@ Usage:
139141
,ov.[last_restored_time] AS [last_restored_time]
140142
,CASE WHEN ov.object_version_lsn = p.object_version_lsn THEN 1 ELSE 0 END AS [is_current_version]
141143
,N'sp_SSISExportProject @folder = ''' + f.[name] + N''', @project = ''' + p.[name] + N''', @version = ' + CONVERT(nvarchar(20), ov.object_version_lsn) + N', @destination = ''' + ISNULL(@destination, N'<<path_to.ispac>>') + N'''' AS [export_command]
144+
,N'EXECUTE [catalog].[restore_project] @folder_name = ''' + f.[Name] + N''', @project_name = ''' + p.[name] + N''', @object_version_lsn = ' + CONVERT(nvarchar(20), ov.object_version_lsn) AS [restore_command]
142145
FROM internal.object_versions ov
143146
INNER JOIN internal.projects p ON p.project_id = ov.object_id AND ov.object_type = 20
144147
INNER JOIN internal.folders f ON f.folder_id = p.folder_id

0 commit comments

Comments
 (0)