I read xsd and xml file in `DataSet`, now I want create db from this `DataSet`

```
foreach (DataTable dt in temp.Tables) {
    foreach (DataColumn dc in dt.Columns) {
        //example for one column
        SqlCommand createtable = new SqlCommand(
            "create table " + dt.TableName + " (" 
            + dc.ColumnName + "  varchar(max))", conn);
        createtable.ExecuteNonQuery();
    }
}

```

But I have some problem, when I create db table I need column type and size from XSD (in example use `varchar(max)`). How to fix this?

For example in xsd I have 

```
<xs:restriction base="xs:string">
<xs:maxLength value="36"/>
<xs:minLength value="1"/>
</xs:restriction>

```

or

```
<xs:restriction base="xs:string">
<xs:maxLength value="40"/>
</xs:restriction>

```

or

```
<xs:restriction base="xs:decimal">
<xs:totalDigits value="19"/>
<xs:fractionDigits value="2"/>
</xs:restriction>

```

In the end I need script to create db tables with size of columns (like in xsd)

UPD: Maybe use `XmlSchemaSet` to parse XSD?