How to create a version view of a specific version

1322
2
08-01-2017 02:27 PM
RichardBunten1
New Contributor III

I need to make a connection to our Enterprise SQL GIS database to view a Feature Class and a stand alone table as they exist in a specific version of the database.  I know about versioned views, but they seem to just access the current state of the Default version of the data.  I want to access the current state of a child of the Default version.  

I am trying to connect to the feature class and table to show a grid view of the records in a non GIS web application.

Is it possible to connect to a table and feature class table in a specific version of our versioned GIS database?

Thanks.

2 Replies
Asrujit_SenGupta
MVP Regular Contributor

Read versioned data in SQL Server using versioned views—Help | ArcGIS Desktop 

Read a specific version state

If you want to query a specific state of the Default version and don't want the state to change while you are querying, execute the set_current_version stored procedure. This procedure validates the supplied version name and sets the corresponding database state internally. If you execute set_current_version for the Default version, queries you make against Default will always point to the state Default referenced when you executed the set_current_version stored procedure.

Set_current_version can be executed directly from an SQL client. The syntax is as follows for an sde-schema geodatabase:

EXEC sde.set_current_version '<version_name>'

For dbo-schema geodatabases, the stored procedure is owned by dbo, so the syntax is as follows:

EXEC dbo.set_current_version '<version_name>'
ZacharyOrdo__GISP
New Contributor III

Asrujit SenGupta How are you using this?  I can execute the EXEC as a Stored Procedure, but I can't use it in a view or query.  I'm trying to publish a view as a feature service to ArcGIS Enterprise, but it only gives me what is in the DEFAULT version.  I need to publish my QA version which is an immediate child of DEFAULT.