Python Scripting-choosing transactional version

3631
5
06-29-2015 12:14 PM
GailJorgenson
New Contributor III

Hello,

I am trying to find some python script that will set the transactional version for our SQL enterprise geodatabase.  We have two versions, the "Default" version and another version we'll call "Enterprise".  After an automated script that runs to reconcile, post, and analyze the "Default" version and another script which analyzes the tables in the "Enterprise" version we would like to set the Transactional version to be the "Enterprise" version.  I have been unable to find any tools or scripts that address this.

I did find the "Change Version" tool in the Data Management toolbox ->Versions -> Change Versions

but, that tool is for only changing a Feature Class and not a Dataset or the entire geodatabase.

Any ideas on how I could make this happen would be greatly appreciated!

Thanks,

Gail Jorgenson

0 Kudos
5 Replies
BlakeTerhune
MVP Regular Contributor

I'm having trouble understanding exactly what you're after. You do not assign one version to a feature class or dataset. Instead, each feature class is viewed/edited in one version at a time. In your case, when you access the feature class for view or edit, you will specify to use the "Enterprise" version. You can do that with Change Version. However, you can also use a database connection with a particular version specified so anything you do with data from that connection will use that version.

Please describe the specific operations/tools your Python script is using on the data.

0 Kudos
GailJorgenson
New Contributor III

Hi Blake,

We have set up the scripts to use different connections, one as a connection to our “Enterprise” version and the other is a connection logging in as the SDE administrator. We run the script for the reconcile post as SDE. Then the analyze on the “Enterprise” connection. But, it changes the transaction version to Default. I was told by the GIS Helpdesk that we could use different connections, but it is still changing.

Gail

0 Kudos
BlakeTerhune
MVP Regular Contributor

I'm still not clear as to what connections are on which version. Here's what I've gathered so far, please fill in the blanks...

"Connection One"

User = ________

Version = Enterprise

"Connection Two"

User = SDE

Version = ________

0 Kudos
GailJorgenson
New Contributor III

Gail

0 Kudos
GailJorgenson
New Contributor III

Resolved this issue by creating a worskspace folder to save our connection files in and recreating our database connections using the Arc Catalog tool found in

Data Management->Workspace->Create Database Connection.

We think that there were two connections files and one was inadvertently set to the wrong version and the incorrect connection was added to our script which was changing the transactional version.

0 Kudos