--- title: "sql:overflow-field (SQLXML 4.0) | Microsoft Docs" ms.custom: "" ms.date: "03/16/2017" ms.prod: "sql-server-2016" ms.reviewer: "" ms.suite: "" ms.technology: - "dbe-xml" ms.tgt_pltfrm: "" ms.topic: "reference" helpviewer_keywords: - "overflow-field annotation" - "unconsumed data" - "overflow data [SQLXML]" - "sql:overflow-field" ms.assetid: f005182b-6151-432d-ab22-3bc025742cd3 caps.latest.revision: 22 author: "douglaslMS" ms.author: "douglasl" manager: "jhubbard" --- # Annotation Interpretation - sql:overflow-field In a schema, you can identify a column as an overflow column to receive all unconsumed data from the XML document. This column is specified in the schema by using the **sql:overflow-field** annotation. It is possible to have multiple overflow columns. Whenever an XML node (element or attribute) for which there is a **sql:overflow-field** annotation defined enters into scope, the overflow column is activated and receives unconsumed data. When the node goes out of scope, the overflow column is no longer active and XML Bulk Load makes the previous overflow field (if any) active. As it stores data in the overflow column, XML Bulk Load also stores the opening and closing tags of the parent element for which **sql:overflow-field** is defined. For example, the following schema describes the **\** and **\** elements. Each of these elements identifies an overflow column: ``` ``` In the schema, the **\** element maps to the Cust table and the **\** element maps to the CustOrder table. Both the **\** and **\** elements identify an overflow column. Thus, XML Bulk Load saves all the unconsumed child elements and attributes of the **\** element in the overflow column of the Cust table, and all the unconsumed child elements and attributes of the **\** element in the overflow column of the CustOrder table. ### To test a working sample 1. Save the schema that is provided in this example as SampleSchema.xml. 2. Create these tables: ``` CREATE TABLE Cust ( CustomerID int PRIMARY KEY, CompanyName varchar(20) NOT NULL, City varchar(20) DEFAULT 'Seattle', OverflowColumn nvarchar(200)) GO CREATE TABLE CustOrder ( OrderID int PRIMARY KEY, CustomerID int FOREIGN KEY REFERENCES Cust(CustomerID), OverflowColumn nvarchar(200)) GO ``` 3. Save the following sample XML data as SampleXMLData.xml: ``` 1111 Hanari Carnes garbage in overflow 1112 Toms Spezialitten
111 Maple, Seattle
1113 Victuailles en stock
``` 4. To execute XML Bulk Load, save and execute this [!INCLUDE[msCoName](../../../includes/msconame-md.md)] Visual Basic Scripting Edition (VBScript) example as Sample.vbs: ``` set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.4.0") objBL.ConnectionString = "provider=SQLOLEDB;data source=localhost;database=tempdb;integrated security=SSPI" objBL.ErrorLogFile = "c:\error.log" objBL.CheckConstraints = True objBL.Execute "c:\SampleSchema.xml", "c:\SampleXMLData.xml" set objBL=Nothing ```