HOW TO

Create attribute rules to access feature classes in a different database

Last Published: April 5, 2024

Summary

Attribute rules are currently set up to function on a specific geodatabase. There are instances where an attribute rule must have access to a feature class in a different enterprise geodatabase. This can be done by creating and registering database views with the geodatabase when the two databases reside on the same instance. This article provides a workflow that allows users to create a view in one database referencing data residing in another database. It is important to note that the user creating these views must have the required permissions to access and query the feature class in the other database.

In this example, we are trying to access the PHARMACIES_TAMALE feature class from the J_Database to use in creating an Attribute Rule on a feature class in the TestingEnvironment database. The two databases are both located in SQL Server.

Procedure

  1. Open SQL Server Management Studio (SSMS) and connect as the Database Administrator or Data Owner.
  2. In SSMS, on the ribbon, click New Query to open the query window.

New Query in SQL Server Management Studio

  1. In the query window, write the following expressions to create a view to access the PHARMACIES_TAMALE feature class from the J_Database.
Use <Active database>
GO
Create view <name of the view>
as
Select * from [Target Database].[Schema Owner].[Name of Feature Class]

Defining a query based on the database and table names

In this example:

    • J_Database is the database that contains the PHARMACIES_TAMALE feature class being accessed.
    • The DataAdmin.vw_pharmacies_JDB is the name of the view, and
    • TestingEnvironment is the active database.
  1. Run the query to create the database view. The next thing is to access the view in ArcGIS Pro:
  2. Open your ArcGIS Pro project.
  3. In the Catalog Pane, if necessary, right-click Databases and connect to the database you are working in by a New Database Connection.
  4. Expand the database and confirm that the view you created is available.

confirming the view

  1. Register the view with the geodatabase:
  2. In the Catalog pane, in the database, right-click the view and choose Register with Geodatabase.
  3. In the Register with Geodatabase geoprocessing tool pane, set and required parameters and then Run the tool.

Registering the view in the geodatabase

The view is registered with the geodatabase and will now be accessible using Arcade with the $datastore function when setting up your Attribute Rules.

Building expressions that use the view with the $datastore function

In this article, we explored creating a view in a database and referencing data from another database on the same instance, as well as registering the view with the geodatabase. The registered view was subsequently used to build Arcade expressions when creating an attribute rule for analysis. We created a view based on a feature class in a different database and then registered the view with the active database.

There are instances where the feature class/table you are trying to access is stored in a different database instance or a different data store (Oracle/PostgreSQL). In this case, database links would have to be created to access these tables.

Article ID: 000032146

Software:
  • ArcGIS Pro

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options