Is http://schemas.varigence.com/biml.xsd down?

Jun 25, 2012 at 6:33 PM

When I try and create a BIML file I keep getting errors stating that I’m violating the schema when I’m clearly not according to language reference: http://varigence.com/documentation/biml/biml_Varigence.Languages.Biml.Table.AstTableNode.html

 

Errors generated:

The ConnectionName Attribute is not valid for Table Element

 

Full BIML Statement

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Connections>
        <OleDbConnection Name="DbConnection" ConnectionString="Server=SERVERNAME;Initial Catalog=DBNAME;Provider=SQLNCLI10.1;Integrated Security=SSPI;"/>
    </Connections>
    <Tables>
        <Table Name="OrderHeader" ConnectionName="DbConnection">
            <Columns>
                <Column Name="OrderId" DataType="Int32" IdentityIncrement="1" IdentitySeed="1"/>
                <Column Name="SalesDate" DataType="DateTime"/>
                <Column Name="CustomerName" DataType="String" Length="50"/>
            </Columns>
            <Keys>
                <PrimaryKey Name="OrderHeaderPK">
                    <Columns>
                        <Column ColumnName="OrderId"/>
                    </Columns>
                </PrimaryKey>
            </Keys>
        </Table>
        <Table Name="OrderDetail" ConnectionName="DbConnection">
            <Columns>
                <Column Name="OrderDetailId" DataType="Int32" IdentityIncrement="1" IdentitySeed="1"/>
                <TableReference Name="OrderId" TableName="OrderHeader"/>
                <Column Name="ProductName" DataType="String" Length="50"/>
                <Column Name="Qty" DataType="Int16"/>
                <Column Name="UnitPrice" DataType="Currency"/>
            </Columns>
            <Keys>
                <PrimaryKey Name="OrderDetailPK">
                    <Columns>
                        <Column ColumnName="OrderDetailId"/>
                    </Columns>
                </PrimaryKey>
            </Keys>
        </Table>
    </Tables>
</Biml>

Sep 24, 2012 at 7:30 PM

I am having the exact same issue with the code above. Using 1.6.1 version. SQL 2012.

Peter

Developer
Sep 24, 2012 at 8:11 PM

The syntax for table specifications has changed to more accurately model how tables work in SQL Server.  The core difference is that you need to create a database object in Biml and/or a schema object.  Then reference the schema from the table The blog post below goes into a bit more detail.

http://biml101.blogspot.com/2012/09/biml-schemas-and-tables.html

While this adds a small amount of code for the common case, it enables all conceivable modeling scenarios - many of which were not possible under the old model.

To use the default schema on the DBNAME database, your Biml for the above case would look something like this:

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Connections>
        <OleDbConnection Name="DbConnection" ConnectionString="Server=SERVERNAME;Initial Catalog=DBNAME;Provider=SQLNCLI10.1;Integrated Security=SSPI;"/>
    </Connections>
    <Databases>
        <Database Name="DBNAME" ConnectionName="DbConnection"/>
    </Databases>
    <Tables>
        <Table Name="OrderHeader" SchemaName="DBNAME.[default]">
            <Columns>
                <Column Name="OrderId" DataType="Int32" IdentityIncrement="1" IdentitySeed="1"/>
                <Column Name="SalesDate" DataType="DateTime"/>
                <Column Name="CustomerName" DataType="String" Length="50"/>
            </Columns>
            <Keys>
                <PrimaryKey Name="OrderHeaderPK">
                    <Columns>
                        <Column ColumnName="OrderId"/>
                    </Columns>
                </PrimaryKey>
            </Keys>
        </Table>
        <Table Name="OrderDetail" ConnectionName="DbConnection">
            <Columns>
                <Column Name="OrderDetailId" DataType="Int32" IdentityIncrement="1" IdentitySeed="1"/>
                <TableReference Name="OrderId" TableName="OrderHeader"/>
                <Column Name="ProductName" DataType="String" Length="50"/>
                <Column Name="Qty" DataType="Int16"/>
                <Column Name="UnitPrice" DataType="Currency"/>
            </Columns>
            <Keys>
                <PrimaryKey Name="OrderDetailPK">
                    <Columns>
                        <Column ColumnName="OrderDetailId"/>
                    </Columns>
                </PrimaryKey>
            </Keys>
        </Table>
    </Tables>
</Biml>


Sep 25, 2012 at 6:12 AM

Works great, thanks. The error I got was due to not using the latest xsd. I had some issues so I downloaded it from here:

http://bidshelper.codeplex.com/wikipage?title=Creating%20Tables%20using%20Biml%20and%20BimlScript&referringTitle=Samples%20and%20Tutorials

And the link to the xsd seems to be pointing to an old one...

 

Thanks for the help!

 

Peter