Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Management Studio losing XML Schema Data?

Author  Topic 

jholovacs
Posting Yak Master

163 Posts

Posted - 2009-09-23 : 13:07:25
If I open a Management Studio window and run this:

create xml schema collection dbo.test_xsd as
N'
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="values">
<xs:complexType>
<xs:sequence>
<xs:element name="diag_cd_pairs" type="diag_cd_pair_list" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>Older and Newer Diagnosis Codes</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="DiagCode">
<xs:restriction base="xs:string">
<xs:maxLength value="6" />
<xs:minLength value="3" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="diag_cd_pair_list">
<xs:sequence>
<xs:element name="diag_cd_pair" type="diag_cd_pair_item" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="diag_cd_pair_item">
<xs:sequence>
<xs:element name="old_diag_cd" type="DiagCode" minOccurs="1" maxOccurs="1">
</xs:element>
<xs:element name="new_diag_cd" type="DiagCode" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:schema>';


... then try to script the object I created out through Management studio, I get something rather different. My namespace changes and element attributes disappear.

Is this a setting somewhere or a Management Studio bug?




SELECT TOP 1
w.[name]
FROM
dbo.women w
INNER JOIN
dbo.inlaws i
ON
i.inlaw_id = w.parent_id
WHERE
i.net_worth > 10000000
AND
i.status IN ('dead', 'dying')
AND
w.husband_id IS NULL
ORDER BY
w.hotness_factor DESC
   

- Advertisement -