Business Intelligence Blogs

View blogs by industry experts on topics such as SSAS, SSIS, SSRS, Power BI, Performance Tuning, Azure, Big Data and much more! You can also sign up to post your own business intelligence blog.

SSIS 2012: Programmatically Create Catalog

  • 18 July 2012
  • Author: mafiswana
  • Number of views: 9992
  • 0 Comments
  • Abstract 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.

Requirements

Article

We begin by launching Microsoft Visual Studio and create a new Integration Services Project which is located under Business Intelligence Projects category. After you have assigned a project name, proceed to click and drag the Script Task into Control Flow pane from toolbox. 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:

Back to the code window, ensure that the following namespaces are declared:

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

IntegrationServices Is_DisHBI = new IntegrationServices(SMO_DisHBI);

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"); sS_Vct.Create(); 

Create a catalog folder and assign description

CatalogFolder sS_Vctf = new CatalogFolder(sS_Vct, "selectSifiso", "Description of selectSifiso folder created via Script Task."); sS_Vctf.Create();

Conclusion

It's that simple!

Cheers.

Sifiso.

Print
Tags:
Rate this article:
No rating

mafiswanamafiswana

Other posts by mafiswana

Please login or register to post comments.