title: How to create table set from several XSD in SQL Server 2012 or with VS 2012
body: <p>is there any solution in T-SQL or in C# how to create XML schema collection in T-SQL or C#.</p>
  
  <p>Problem is I cannot use:</p>
  
  <pre><code>USE Database_test
  GO
  CREATE XML SCHEMA COLLECTION Collection_from_XSD AS
  N'
  .................
  text of XSD
  ...............
  GO
  </code></pre>
  
  <p>because I have lot of XSD (about 30) which having a dependency among themselves. So I´d like to do something like:</p>
  
  <pre><code>USE Database_test
  GO
  
  CREATE XML SCHEMA COLLECTION Collection_from_XSD AS N'C:\work\xsd\exange_format\VymennyFormatTypy.xsd'
  </code></pre>
  
  <p>But this throws me an error </p>
  
  <blockquote>
    <p>Msg 2378, Level 16, State 1, Line 2 It was expected XML schema document.</p>
  </blockquote>
  
  <p>So I´d like to ask you for help how create this schema from XSD in T-SQL or in C# in Visual Studio 2012 project.
  I have access to SQL server 2012 with full permission for managing database, so I´d like to prefer T-SQL, but if there won´t be any other choice I will use C#.
  The database will be used as a local database of the exchange format of addresses and real estates, so the first step is populate database from XML
  The second step is update database every week from other XML files
  For example I attached picture of the XSD and XSD summary from Visual Studio.</p>
  
  <p>Thank you very much</p>
  
  <p><img src="https://i.stack.imgur.com/rwXJx.png" alt="full XSD scheme"></p>
  
  <p><img src="https://i.stack.imgur.com/L0XfG.png" alt="XSD example"></p>