Developing Microsoft SQL Server Databases — Question 5
You have a text file that contains an XML Schema Definition (XSD).
You have a table named Schema1.Table1.
You have a stored procedure named Schema1.Proc1 that accepts an XML parameter named Param1.
You need to store validated XML data in Schema1.Table1. The solution must ensure that only valid XML data is accepted by Param1.
What should you do? (Each correct answer presents part of the solution. Choose all that apply.)
Answer options
- A. Define an XML column in Table1 by using an XML schema collection.
- B. Create an XML schema collection in the database from the text file.
- C. Declare Param1 var1 as type XML and associate the variable to the XML schema collection.
- D. use the modify method to insert the XML schema into each row of the XML column in Table1.
Correct answer: A, B, D
Explanation
Option A is correct because defining an XML column with an XML schema collection ensures that only valid XML data can be stored. Option B is necessary to create the XML schema collection from the provided XSD file, which validates the XML data. Option D, while it modifies the XML column, is not needed to ensure valid XML data is accepted; thus, it is not essential for the solution.