M
Mukesh
Hi
all
I m Using SQL SERVER 2005
I have a requirement to store some data in xmldatatype using stored
procedure ,
Here is example
+++++++++
Database
=======================================================================
id(bigint) Name(NvarChar) Email(NvarChar) DetailXml(XML)
=======================================================================
1 Mukesh (e-mail address removed) null
2 Komal (e-mail address removed) null
=======================================================================
I have this type of data for Mukesh in stored procedure in database
server MSsql 2005 based server as input parameter
@id =1
@AddressType=Home
@Street1= Ground Floor
@Street2= C-81
@Street3= Sector19
@City = Noida
@DOb = 21-4-1982
@mobile = 919911847767
for storing this data in DetailXml (Datatype XML) xml schema i Have
creted to associate with the deatilsXml
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="test2" targetNamespace="http://tempuri.org/test2.xsd"
elementFormDefault="qualified" xmlns="http://tempuri.org/test2.xsd"
xmlns:mstns="http://tempuri.org/test2.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="UserDetails">
<xs:complexType>
<xs:sequence>
<xs:element name="Address">
<xs:complexType>
<xs:sequence>
<xs:element name="Street1" type="xs:string" />
<xs:element name="Street2" type="xs:string" />
<xs:element name="Street3" type="xs:string" />
<xs:element name="City" type="xs:unsignedLong" />
</xs:sequence>
<xs:attribute name="Type" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="Dob" type="xs:date" />
<xs:element name="Mobile" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Please Help me how can i enter the data in Detailsxml column using the
only stored procedure and a schema written above suggest me if there is
any change or err in schema
My desired input in the detailsxml cell for user mukesh is
<UserDetails>
<Address type="Home">
<Street1>Ground Floor
</Street1>
<Street2>C-81
</Street2>
<Street3>Sector19
</Street3>
</Address>
<Dob>
21-4-1982
</Dob>
<Mobile>919911847767
</Mobile>
</UserDetails>
all
I m Using SQL SERVER 2005
I have a requirement to store some data in xmldatatype using stored
procedure ,
Here is example
+++++++++
Database
=======================================================================
id(bigint) Name(NvarChar) Email(NvarChar) DetailXml(XML)
=======================================================================
1 Mukesh (e-mail address removed) null
2 Komal (e-mail address removed) null
=======================================================================
I have this type of data for Mukesh in stored procedure in database
server MSsql 2005 based server as input parameter
@id =1
@AddressType=Home
@Street1= Ground Floor
@Street2= C-81
@Street3= Sector19
@City = Noida
@DOb = 21-4-1982
@mobile = 919911847767
for storing this data in DetailXml (Datatype XML) xml schema i Have
creted to associate with the deatilsXml
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="test2" targetNamespace="http://tempuri.org/test2.xsd"
elementFormDefault="qualified" xmlns="http://tempuri.org/test2.xsd"
xmlns:mstns="http://tempuri.org/test2.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="UserDetails">
<xs:complexType>
<xs:sequence>
<xs:element name="Address">
<xs:complexType>
<xs:sequence>
<xs:element name="Street1" type="xs:string" />
<xs:element name="Street2" type="xs:string" />
<xs:element name="Street3" type="xs:string" />
<xs:element name="City" type="xs:unsignedLong" />
</xs:sequence>
<xs:attribute name="Type" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="Dob" type="xs:date" />
<xs:element name="Mobile" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Please Help me how can i enter the data in Detailsxml column using the
only stored procedure and a schema written above suggest me if there is
any change or err in schema
My desired input in the detailsxml cell for user mukesh is
<UserDetails>
<Address type="Home">
<Street1>Ground Floor
</Street1>
<Street2>C-81
</Street2>
<Street3>Sector19
</Street3>
</Address>
<Dob>
21-4-1982
</Dob>
<Mobile>919911847767
</Mobile>
</UserDetails>