views:

167

answers:

1

I'm looking for info on how to write SQL scripts to automate the creation of a versioned feature class in ArcSDE I want to be able to automate the process itself as well as put the scripts under version control. Can anyone point me to a resource that explains how to do this?

Is this even possible? It seems like there are lots of interrelationships between tables and data when a feature class is added.

P.S. It doesn't have to be pure SQL, but it should be some kind of scripting so we can save to version control and run outside of ESRI desktop tools.

+2  A: 

It would be exceedingly difficult to do this in SQL without breaking your database. As you indicated, there are a lot of relationships between the tables, and if you don't get it right, then your database is messed up.

If you're looking at a scripted solution, you might want to look at creating a Python script to create the versioned feature class. There are a few ways to do it, from creating a raw Python script in Notepad, to creating a geoprocessing model in ArcCatalog and exporting the model to a Python script.

Here's a link to the ESRI help on geoprocessing scripts: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_writing_geoprocessing_scripts

SpatialBridge
I agree, _don't_ do this by hand; too many things could go wrong. You (@Keith G) already have ArcSDE installed so you should also have Python installed and, therefore, everything you need to do it "the right way" without having write everything from scratch (including the low-level stuff).
Michael Todd