Showing posts with label functionality. Show all posts
Showing posts with label functionality. Show all posts

Thursday, March 22, 2012

Automatic XSD generation

Hello everyone,
Is there standard functionality to generate XSD files, which i can use
from within a program?
If so, please let me know where i can find more information.
Thanks
'I'm a raven, aren't I?' it said. 'One of the few birds who speak. The first
thing people say is, oh, you're a raven, go on, say the N word... If I had a
penny for every time that's happened, I'd-'
(Soul Music)
There are quite a few ways to handle XSDs.
From SQL, using XMLDATA attaches the Schema to your results. If you run a
query like:
SELECT * FROM Customers
FOR XML AUTO, XMLDATA
you will have a schema attached that is attribute centric. You can change to
elements like:
SELECT * FROM Customers
FOR XML AUTO, ELEMENTS, XMLDATA
But, you still have a schema attached to the top of an XML snippet (no root
tag). If you just want schema, you end up having to remove the records.
Something like:
SELECT * FROM Customers
WHERE 1 = 0
FOR XML AUTO, ELEMENTS, XMLDATA
You are still missing root tag, however, which makes the XSD only
semi-useful, IMO.
With .NET, you can create a DataSet and return the XML Schema. This creates
an XSD that is valid. BUT, you end up with the extra weight of the DataSet
tags that surround your table of records. This is not a huge burden, overall,
but it can add a bit of extra work to those consuming your XML outside of the
..NET platform. It is, overall, easier than working directly with the SQL
"autogen" capabilities.

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Mark Pustjens" wrote:

> Hello everyone,
> Is there standard functionality to generate XSD files, which i can use
> from within a program?
> If so, please let me know where i can find more information.
> Thanks
> --
> 'I'm a raven, aren't I?' it said. 'One of the few birds who speak. The first
> thing people say is, oh, you're a raven, go on, say the N word... If I had a
> penny for every time that's happened, I'd-'
> (Soul Music)
>
|||Note that the XMLDATA directive generates the older XDR format and not the
XSD format.
Best regards
Michael
"Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@.comcast.netNoSpamM> wrote
in message news:0888E260-B1EC-49D5-B7BE-0FD4A383156E@.microsoft.com...[vbcol=seagreen]
> There are quite a few ways to handle XSDs.
> From SQL, using XMLDATA attaches the Schema to your results. If you run a
> query like:
> SELECT * FROM Customers
> FOR XML AUTO, XMLDATA
> you will have a schema attached that is attribute centric. You can change
> to
> elements like:
> SELECT * FROM Customers
> FOR XML AUTO, ELEMENTS, XMLDATA
> But, you still have a schema attached to the top of an XML snippet (no
> root
> tag). If you just want schema, you end up having to remove the records.
> Something like:
> SELECT * FROM Customers
> WHERE 1 = 0
> FOR XML AUTO, ELEMENTS, XMLDATA
> You are still missing root tag, however, which makes the XSD only
> semi-useful, IMO.
> With .NET, you can create a DataSet and return the XML Schema. This
> creates
> an XSD that is valid. BUT, you end up with the extra weight of the DataSet
> tags that surround your table of records. This is not a huge burden,
> overall,
> but it can add a bit of extra work to those consuming your XML outside of
> the
> .NET platform. It is, overall, easier than working directly with the SQL
> "autogen" capabilities.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ***************************
> Think Outside the Box!
> ***************************
> "Mark Pustjens" wrote:

Automatic XSD generation

Hello everyone,
Is there standard functionality to generate XSD files, which i can use
from within a program?
If so, please let me know where i can find more information.
Thanks
'I'm a raven, aren't I?' it said. 'One of the few birds who speak. The first
thing people say is, oh, you're a raven, go on, say the N word... If I had a
penny for every time that's happened, I'd-'
(Soul Music)There are quite a few ways to handle XSDs.
From SQL, using XMLDATA attaches the Schema to your results. If you run a
query like:
SELECT * FROM Customers
FOR XML AUTO, XMLDATA
you will have a schema attached that is attribute centric. You can change to
elements like:
SELECT * FROM Customers
FOR XML AUTO, ELEMENTS, XMLDATA
But, you still have a schema attached to the top of an XML snippet (no root
tag). If you just want schema, you end up having to remove the records.
Something like:
SELECT * FROM Customers
WHERE 1 = 0
FOR XML AUTO, ELEMENTS, XMLDATA
You are still missing root tag, however, which makes the XSD only
semi-useful, IMO.
With .NET, you can create a DataSet and return the XML Schema. This creates
an XSD that is valid. BUT, you end up with the extra weight of the DataSet
tags that surround your table of records. This is not a huge burden, overall
,
but it can add a bit of extra work to those consuming your XML outside of th
e
.NET platform. It is, overall, easier than working directly with the SQL
"autogen" capabilities.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Mark Pustjens" wrote:

> Hello everyone,
> Is there standard functionality to generate XSD files, which i can use
> from within a program?
> If so, please let me know where i can find more information.
> Thanks
> --
> 'I'm a raven, aren't I?' it said. 'One of the few birds who speak. The fir
st
> thing people say is, oh, you're a raven, go on, say the N word... If I had
a
> penny for every time that's happened, I'd-'
> (Soul Music)
>|||Note that the XMLDATA directive generates the older XDR format and not the
XSD format.
Best regards
Michael
"Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@.comcast.netNoSpamM> wrote
in message news:0888E260-B1EC-49D5-B7BE-0FD4A383156E@.microsoft.com...
> There are quite a few ways to handle XSDs.
> From SQL, using XMLDATA attaches the Schema to your results. If you run a
> query like:
> SELECT * FROM Customers
> FOR XML AUTO, XMLDATA
> you will have a schema attached that is attribute centric. You can change
> to
> elements like:
> SELECT * FROM Customers
> FOR XML AUTO, ELEMENTS, XMLDATA
> But, you still have a schema attached to the top of an XML snippet (no
> root
> tag). If you just want schema, you end up having to remove the records.
> Something like:
> SELECT * FROM Customers
> WHERE 1 = 0
> FOR XML AUTO, ELEMENTS, XMLDATA
> You are still missing root tag, however, which makes the XSD only
> semi-useful, IMO.
> With .NET, you can create a DataSet and return the XML Schema. This
> creates
> an XSD that is valid. BUT, you end up with the extra weight of the DataSet
> tags that surround your table of records. This is not a huge burden,
> overall,
> but it can add a bit of extra work to those consuming your XML outside of
> the
> .NET platform. It is, overall, easier than working directly with the SQL
> "autogen" capabilities.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ***************************
> Think Outside the Box!
> ***************************
> "Mark Pustjens" wrote:
>

Monday, March 19, 2012

Automatic index (Statistics) vs Manually created indexes

Hi,
I noticed SQL Server, version 2000 in my case, automatically created indexes
(WA_Sys_... indexes) based on its query optimization functionality.
My question is; would my database performance increase if I created indexes
manually instead of depending on the (correct) created automatic indexes?
Erik
Hi
WA_ are not indexes, but statstics.
A real index is much better than statistics. A statistic is there to help
the query optimiser decide how to process a query, and not used for data
access.
http://www.sql-server-performance.com
Regards
Mike
"Erik Tamminga" wrote:

> Hi,
> I noticed SQL Server, version 2000 in my case, automatically created indexes
> (WA_Sys_... indexes) based on its query optimization functionality.
> My question is; would my database performance increase if I created indexes
> manually instead of depending on the (correct) created automatic indexes?
> Erik
>
>

Automatic index (Statistics) vs Manually created indexes

Hi,
I noticed SQL Server, version 2000 in my case, automatically created indexes
(WA_Sys_... indexes) based on its query optimization functionality.
My question is; would my database performance increase if I created indexes
manually instead of depending on the (correct) created automatic indexes?
ErikHi
WA_ are not indexes, but statstics.
A real index is much better than statistics. A statistic is there to help
the query optimiser decide how to process a query, and not used for data
access.
http://www.sql-server-performance.com
Regards
Mike
"Erik Tamminga" wrote:
> Hi,
> I noticed SQL Server, version 2000 in my case, automatically created indexes
> (WA_Sys_... indexes) based on its query optimization functionality.
> My question is; would my database performance increase if I created indexes
> manually instead of depending on the (correct) created automatic indexes?
> Erik
>
>

Automatic index (Statistics) vs Manually created indexes

Hi,
I noticed SQL Server, version 2000 in my case, automatically created indexes
(WA_Sys_... indexes) based on its query optimization functionality.
My question is; would my database performance increase if I created indexes
manually instead of depending on the (correct) created automatic indexes?
ErikHi
WA_ are not indexes, but statstics.
A real index is much better than statistics. A statistic is there to help
the query optimiser decide how to process a query, and not used for data
access.
http://www.sql-server-performance.com
Regards
Mike
"Erik Tamminga" wrote:

> Hi,
> I noticed SQL Server, version 2000 in my case, automatically created index
es
> (WA_Sys_... indexes) based on its query optimization functionality.
> My question is; would my database performance increase if I created indexe
s
> manually instead of depending on the (correct) created automatic indexes?
> Erik
>
>