ViewImplementation Element

The ViewImplementation element implements the query view as a database view.

Tip: The TVFImplementation element is also available to implement the query view as a table-valued function. The main difference is that a database view is simpler and consists entirely of a SELECT statement, so you can't perform complicated logic with it or pass context or variables to it. If your query requires context or complicated logic, you need to use the TVFImplementation element. Otherwise, you generally should use the ViewImplementation element.

<ViewImplementation ViewName="USR_V_EXAMPLEQUERY">
<ViewSQL>
<![CDATA[
select
ID,
EXAMPLE,
EXAMPLE2
from dbo.TABLE1
]]>
</ViewSQL>
</ViewImplementation>

Within the ViewImplementation element, the ViewName attribute provides the name of the view to create in SQL Server. You should prefix view names with "USR_" to avoid name collisions with future updates from Blackbaud.

The child ViewSQL element contains the SELECT statement that defines the view.

Note: To ensure the best performance, make sure your Transact-SQL code is as efficient as possible.