--- title: "sql:limit-field and sql:limit-value (SQLXML)" description: "Learn how to use the SQLXML annotations sql:limit-field and sql:limit-value to filter data when using XML Bulk Load." author: MikeRayMSFT ms.author: mikeray ms.date: "03/14/2017" ms.prod: sql ms.prod_service: "database-engine, sql-database" ms.technology: xml ms.topic: "reference" ms.custom: "seo-lt-2019" helpviewer_keywords: - "limiting values [SQLXML]" - "limit-value annotation" - "limit-field annotation" ms.assetid: 402c21cf-9566-463f-a928-f94270c11db3 monikerRange: "=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current" --- # Annotation Interpretation - sql:limit-field and sql:limit-value [!INCLUDE [SQL Server Azure SQL Database](../../../includes/applies-to-version/sql-asdb.md)] XML Bulk Load processes the **sql:limit-field** and **sql:limit-value** annotations per their definition. For more information, see [Filtering Values Using sql:limit-field and sql:limit-value (SQLXML 4.0)](../../../relational-databases/sqlxml-annotated-xsd-schemas-using/filtering-values-using-sql-limit-field-and-sql-limit-value-sqlxml-4-0.md). For example, suppose a database contains the following tables: - Customer (CustomerID, CompanyName) - Addresses (CustomerID, StreetAddress, AddressType) A customer can have many addresses, and each address has an address type associated with it (for example, a shipping address or a billing address). Now consider this XML view of these tables as specified in the following annotated XSD schema: ``` ``` Upon receiving this schema and XML data, XML Bulk Load inserts the value that is specified for the BillTo attribute into the StreetAddress column of the CustAddress table along with the "billing" value for the AddressType column. Similarly, XML Bulk Load inserts the value that is specified for the ShipTo attribute into the StreetAddress column along with the "shipping" value in the AddressType column. ### To test a working sample 1. Save the schema that is provided in this example as SampleSchema.xml. 2. Create these tables: ``` CREATE TABLE Customer( CustomerID int PRIMARY KEY, CompanyName varchar(20) NOT NULL) GO CREATE TABLE Address( CustomerID int FOREIGN KEY REFERENCES Customer(CustomerID), StreetAddress varchar(50), AddressType varchar(10)) GO ``` 3. Save the following sample data as SampleXMLData.xml: ``` ``` 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.XMLFragment = True objBL.CheckConstraints=True objBL.Execute "c:\SampleSchema.xml", "c:\SampleXMLData.xml" set objBL=Nothing ``` This is the equivalent XDR schema: ``` ```