Quantcast
Channel: SQLServerCentral » SQL Server 2012 » SQL Server 2012 - T-SQL » Latest topics
Viewing all articles
Browse latest Browse all 4901

XML strange problem

$
0
0
Ok I'm doing a few exercises in SQL Server 2012And I did the following[code="sql"]IF OBJECT_ID('ClientInfoCollection') IS NOT NULLDROP XML SCHEMA COLLECTION ClientInfoCollection;GOCREATE XML SCHEMA COLLECTION ClientInfoCollection AS '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:ClientInfoNamespace" targetNamespace="urn:ClientInfoNamespace" elementFormDefault="qualified"> <xsd:element name="People"> <xsd:complexType> <xsd:sequence> <xsd:element name="Person" minOccurs="1" maxOccurs="unbounded"> <xsd:complexType> <xsd:sequence> <xsd:element name="FirstName" type="xsd:string" minOccurs="1" maxOccurs="1" /> <xsd:element name="LastName" type="xsd:string" minOccurs="1" maxOccurs="1" /> <xsd:element name="FavoriteBooks" minOccurs="0" maxOccurs="1"> <xsd:complexType> <xsd:sequence> <xsd:element name="Book" type="xsd:string" minOccurs="0" maxOccurs="5" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> <xsd:attribute name="id" type="xsd:integer" use="required"/> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element></xsd:schema>';GO[/code]And I get the following message[code]Msg 6348, Level 16, State 1, Line 2Specified collection 'ClientInfoCollection' cannot be created because it already exists or you do not have permission.[/code]I don't get it,why am I getting this error

Viewing all articles
Browse latest Browse all 4901

Trending Articles