I have a client that has already started migrating existing SQL Server environments to SQL Server 2012. Thus, this article will demonstrate creating a catalog and catalog folder using a Script Task component.
Right click the script task and click on “Edit”
Under the Script Task Editor change the “ScriptLanguage” to “Microsoft Visual C# 2010”.
In Project Explorer, ensure the following references are added:
After the above declarations, proceed to creating an instance of SMO Server to server “SQL12-PC”
Server SMO_DisHBI = new Server(“SQL12-PC”);
Create an instance of MOM – Managed Object Model class
Initialise MOM with SMO Server
//Create a catalog and assign password.
//Ensure that catalog name is “SSISDB” as per SQl Server 2012 RTM guidelines
Catalog sS_Vct = new Catalog(sS_Is, “SSISDB”, “password”);
//Create a catalog folder and assign description
CatalogFolder sS_Vctf = new CatalogFolder(sS_Vct, “selectSifiso”, “Description of selectSifiso folder created via Script Task.”);
It’s that simple!