Jigsaw Blog

24

Oct
2012
0 comments

Generate xsd from NAV Tables

If you need to generate an xsd to represent a NAV table, use the following SQL command


DECLARE @Schema xml

SET @Schema = (SELECT top 1 * FROM [Suntory Live$Item]FOR XML AUTO, ELEMENTS, XMLSCHEMA('Item'))
-- see the created schema
select @Schema

You'll then need to tidy up the xsd. I replaced all the _x0020_ with blank as an example