Database Reference
In-Depth Information
Create and Store XML Data : In the following, the column Email with the XML data
type will be added to the table CUSTOMER. Next, an XML variable, email will be created
and assigned with the untyped XML data. hen, the data will be inserted into the table
CUSTOMER.
1. Start SSMS by pressing the Windows Icon key and click the SQL Server
Management Studio icon on the tile. After the SSMS is opened, right click the
database Computer_Store and select New Query . Similar to Figure 5.2, enter your
login information to Windows Azure SQL Database and then click the Connect
button. Enter the SQL statement shown in Figure 5.41 in the New Query editor,
and then click the !Execute button on the toolbar.
2. To declare the XML variable @email and assign a well-formed XML document to
the variable, and then store the XML document in the XML column, enter the code
shown in Figure 5.42.
3. To display the inserted XML data, enter the command shown in Figure 5.43.
Store XML E-Mail Addresses : In the following, XML e-mail addresses will be created
with the customers' irst names and last names in the XML format. hen, the XML e-mail
addresses will be stored in the Email column in the CUSTOMER table.
Figure 5.41
Add column with XML data type.
Figure 5.42
Create and store XML data.
Search WWH ::




Custom Search