How To: Create a spatially enabled view between databases using SQL Server


Instructions provided describe how to create a view with data from an ArcSDE layer in one SQL Server database and a table in another SQL Server database in the same SQL Server instance.

This applies only to geodatabases using the multiple database model.


This example assumes the following:

- The layer is in a database called vtest
- The table is in the sde database
- The layer is called us_statesview
- The table is called us_capitalsview

Use sdetable to create the view:

sdetable -o create_view -T nView ^
-t us_statesview,sde.gdb.us_capitalsview ^
-c us_statesview.feature,us_statesview.state_name,sde.gdb.us_capitalsview.pop1990 ^
-w "us_statesview.State_name=sde.gdb.us_capitalsview.State_name and sde.gdb.us_capitalsview.pop1990 < 50000" ^
-i sql82k -D vtest -u gdb -p gdb

ArcSDE 8.1 Build 615 Tue Nov 7 22:48:28 PST 2000
Attribute Administration Utility
Successfully created view nView.

Related Information