0

is there any solution in T-SQL or in C# how to create XML schema collection in T-SQL or C#.

Problem is I cannot use:

USE Database_test
GO
CREATE XML SCHEMA COLLECTION Collection_from_XSD AS
N'
.................
text of XSD
...............
GO

because I have lot of XSD (about 30) which having a dependency among themselves. So I´d like to do something like:

USE Database_test
GO

CREATE XML SCHEMA COLLECTION Collection_from_XSD AS N'C:\work\xsd\exange_format\VymennyFormatTypy.xsd'

But this throws me an error

Msg 2378, Level 16, State 1, Line 2 It was expected XML schema document.

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.

Thank you very much

full XSD scheme

XSD example

4

1 回答 1

0

在您的CREATE XML SCHEMA COLLECTION声明中,不要指定XSD 文件的文件名。

相反,将 XSD 文件的内容复制并粘贴到语句中(并确保 XSD 不包含'会使 DLL 语句格式错误的字符)。

于 2013-05-08T19:07:35.783 回答