Database Reference
In-Depth Information
ure, and then queries the status of the deployment from the [cata-
log].[operations] view.
Listing 18-4 . Deploying a project using the SQL API
use SSISDB
DECLARE @ProjectBinary as varbinary(max)
DECLARE @OperationID as bigint
-- load the project file
SET @ProjectBinary =
(
SELECT *
FROM OPENROWSET
(
BULK 'C:\ETL\Project.ispac',
SINGLE_BLOB
) as BinaryData
)
-- deploy the project
EXEC [catalog].[deploy_project]
'MyFolder', -- folder
'Project', -- project name
@ProjectBinary, -- binary data
@OperationID out -- operation id
--
-- Get the status of the last deployment
--
DECLARE @LastDeployment_id bigint;
SET @LastDeployment_id =
(
SELECT MAX(operation_id)
FROM [catalog].[operations]
WHERE operation_type = 101 -- deploy
 
Search WWH ::




Custom Search