Vulcan Lesson 1: Hello, World!

As every programming language book, we’ll start from the “Hello, World!” sample.

Starting from now, we’ll work on our own test database, with a name “TestDataWarehouse”. So you need to create a database with the same name in your SQL Server.

The first Vulcan XML file looks as simple as below: “HelloWorld.xml”

<?xml version="1.0" encoding="utf-8" ?>

<Vulcan xmlns="https://tempuri.org/vulcan2.xsd">

      <Connections>

            <Connection Name="TestDataWarehouse" Type="OLEDB" ConnectionString="Data Source=localhost\sql2008;Initial Catalog=TestDataWarehouse;Provider=SQLNCLI10.1;Integrated Security=SSPI;" />

      </Connections>

      <Table Name="HelloWorld" ConnectionName="TestDataWarehouse">

            <Columns>

                  <Column Name="HelloID" Type="INT64" />

                  <Column Name="HelloName" Type="WSTR" Length="255" IsNullable="true" />

            </Columns>

            <Keys>

                  <PrimaryKey Name="PK_HelloPrimary" Clustered="true">

                        <Column ColumnName="HelloID" />

                  </PrimaryKey>

            </Keys>

            <Sources>

                  <StaticSource>

                        <Row>0, 'Hello, World!'</Row>

                        <Row>1000, 'Hello, World 1000 times!'</Row>

                  </StaticSource>

            </Sources>

      </Table>

</Vulcan>

 

Copy and save it to HelloWorld.xml.

The only possible change you may need to modify is the ConnectionString. Your SQL server instance may be a different one, or even the default noname instance. So just modify the localhost\sql2008 to your own instance name.

Let’s bring the command window work environment we set in Lesson 0, type:

vulcan HelloWorld.xml

You’ll notice the output information and a progress bar. Because we only have 1 simple test file here to be compiled, the progress bar will advance to 100% very quickly.

2 folders will be created along with the HelloWorld.xml file.

The “PackageConfigurations” folder needs to be copied to the root of C: drive, i.e., C:\.

Then you can step into the “Table\HelloWorld” folder, either execute it from command line or from the GUI tools.

This folder contains the following files:

· “HelloWorld.dtproj”, the project file of HelloWorld, which you can open with Visual Studio to check its contents.

· “HelloWorld.dtsx”, the package file of HelloWorld, which you can execute from command line or GUI, such as Visual Studio.

· Create Table.sql, the automatically generated helper file.

Once you execute this package, you’ll find a table named “HelloWorld” generated in your database, with columns, keys, and 2 rows of values as shown in the XML code.

This is just the beginning of how to use Vulcan, only shows you the convenience you can benefit from it: fast development, clear code for anyone to read, and easy maintenance.

We’ll learn more in the following lessons.