Home » Microsoft » 70-461 v.2 » Which three Transact-SQL segments should you use to develop the solution?
DRAG DROP
You are developing a Microsoft SQL Server database.
You need to meet the following requirements:
Create a table that contains a primary key column and an XML data column.
Prevent insertion of invalid XML.
Load an XML document.
Which three Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.
Select and Place:
Correct Answer:
Explanation/Reference:
Explanation:
Box 1: CREATE XML SCHEMA COLLECTION MySchema AS…
CREATE XML SCHEMA COLLECTION imports the schema components into a database.
Box 2: CREATE TABLE .. xmlColumn xml(MySchema)
Create a typed xml variable by specifying an XML schema collection, as shown in the following example.
DECLARE @x xml (Sales.StoreSurveySchemaCollection)
Box 3: LoadXml()
LoadXml() loads the XML document from the specified string.
Reference:
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-xml-schema-collection-transact-sql
https://docs.microsoft.com/en-us/sql/relational-databases/xml/create-xml-data-type-variables-and-columns