Database Reference
In-Depth Information
end
Else
print 'SSISConfig database already exists.'
print ''
go
The script in Listing A-2 is re-executable. Plus, it informs the person executing the
script about its actions via Print statements. The first time you execute this script,
you will see the following messages in the SSMS Messages tab:
Creating SSISConfig database
SSISConfig database created
The second time—and each subsequent time—you execute the same script, you
will see this message:
SSISConfig database already exists.
Writing re-executable T-SQL is not always feasible, but when feasible, it is a good
idea. Now that we have the database, we'll build a table to hold SSIS package
metadata. Listing A-3 contains T-SQL for such a table.
Listing A-3 . Building the cfg Schema and cfg.Packages Table
Use SSISConfig
go
/* cfg schema */
If Not Exists(Select name
From sys.schemas
Where name = 'cfg')
begin
print 'Creating cfg schema'
declare @sql varchar(100) = 'Create Schema cfg'
exec(@sql)
print 'Cfg schema created'
end
Else
print 'Cfg schema already exists.'
 
 
Search WWH ::




Custom Search