Skip to content

Latest commit

 

History

History
71 lines (49 loc) · 8.88 KB

browse-search-and-get-sql-server-metadata.md

File metadata and controls

71 lines (49 loc) · 8.88 KB
description title ms.custom ms.date ms.service ms.reviewer ms.suite ms.topic
Learn more about: Browse, search, and get SQL Server metadata
Browse, search, and get SQL Server metadata
06/08/2017
biztalk-server
article

Browse, search, and get SQL Server metadata

The metadata that [!INCLUDEadaptersql] surfaces from the SQL Server database describes the message structure for communicating with the SQL Server database using the adapter. The [!INCLUDEadaptersqlshort] supports two interfaces for retrieving metadata.

  • MetadataExchange provided by [!INCLUDEfirstref_btsWinCommFoundation]. WCF provides a metadata-exchange endpoint for all WCF bindings, which enables clients to get metadata from the SQL Server database.

  • IMetadataRetrievalContract provided by the [!INCLUDEafproductnamelong], which supports the metadata browsing and searching capabilities of the adapter.

    The [!INCLUDEadaptersqlshort] surfaces the SQL Server database artifacts and respective operations that the adapter clients can invoke. The adapter also surfaces operations (such as ExecuteNonQuery, ExecuteReader, and ExecuteScalar) that can be used to perform specific operations on the SQL Server database. These operations are discussed later in this topic.

Note

The [!INCLUDEadaptersqlshort] surfaces artifacts in all the schemas in the SQL Server database that the currently connected user has access to. This implies that apart from the default schema (dbo), the adapter clients can also perform operations on artifacts in other schemas in the SQL Server database provided that the user credentials used to connect using the [!INCLUDEadaptersqlshort] has access to those schemas in the SQL Server database. For information about a schema in SQL Server database, see https://go.microsoft.com/fwlink/?LinkId=130148.

You can use the adapter clients to browse, search, and retrieve metadata by:

Browsing Metadata

The [!INCLUDEadaptersqlshort] enables adapter clients to browse database tables, views, stored procedures, and functions that are available in the SQL Server database. As part of the metadata browse operation, the adapter also surfaces the operations that can be performed on the SQL Server database, including some custom operations supported by the adapters. These operations are available from [!INCLUDEconsumeadapterservshort], [!INCLUDEaddadapterwiz] or [!INCLUDEaddadapterservrefshort]. The [!INCLUDEadaptersqlshort] surfaces the following operations:

Searching Metadata

With the [!INCLUDEadaptersqlshort], it is possible to perform a search query on the SQL Server database by using the SQL Server search expressions that are compatible with the LIKE operator. For example, adapter clients can use a search expression such as “EMP%” to obtain tables starting with EMP. The adapter converts this to the following SQL query:

SELECT TABLE_NAME FROM ALL_TABLES WHERE TABLE_NAME LIKE 'EMP%'

The following table lists the special characters that can be used for search and their interpretation by the [!INCLUDEadaptersqlshort].

Special character Interpretation
_ (underscore) Matches exactly one character.

For example, “A_” matches “AB”, “AC”, “AD”.
% (percentage) Matches zero or more characters.

For example, “A%” matches “A”, “AB”, “ABC”.
[ ] - Escapes the special meaning of _ and %.
- Specifies a range or set of characters to be present.

For example:

- %[%]% matches all names that include a % symbol.
- [a-f] matches all names that have characters between and including ‘a’ and ‘f’.
- [abc] matches all names that have characters ‘a’, ‘b’, and ‘c’.
[^] Specifies a range or set of characters not to be present.

For example:

- [^a-f] matches all names that do not have characters between and including ‘a’ and ‘f’.
- [^abc] matches all names that do not have characters ‘a’, ‘b’, and ‘c’.

Important

The metadata search scope is restricted to the level immediately under the node at which the search operation is performed. For example, to search for a scalar function, you must be searching under /Scalar Function/[Schema]. Multi-level search is not supported.

Retrieving Metadata

When retrieving metadata, the [!INCLUDEadaptersqlshort] can extract metadata under a schema, including all or a subset of database objects with the respective object and operation parameters. The adapter presents the entities from the SQL Server database as element names in XML. Because underscores are the only permissible special characters that can be included, all other special characters in the element names are encoded using underscores. For example, emp$name is encoded as emp_x0024_name.

See Also

Overview of BizTalk Adapter for SQL Server Understand BizTalk Adapter for SQL Server Get metadata for SQL Server operations in Visual Studio using the SQL adapter