Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using ArcGIS Desktop 10 and have no experience using Python with a SQL Server ArcSDE database. When using a shp file or file gdb it is very simple to reference a given feature class by simply typing the file path to that file or gdb. However, this seems to be much different when working with mdf files with SQL Server. I can't find any help with this in the resource center. I did read some about making a arcsde connection but I had no luck with that. Any help with the Python code to do this would be a great help.

share|improve this question
up vote 1 down vote accepted

The way you typically connect to feature classes on an ArcSDE database in Python is to first create a SDE connection file using ArcCatalog or the CreateArcSDEConnectionFile_management command in arcpy.

Then simply reference the feature class through it's Catalog Path (the path you see in ArcCatalog when you browse to an SDE feature class).

See this related question: How does one access a featurelayer in SDE via Python?

share|improve this answer
Thanks for your help and direction. So I seem to be having a new problem now, I can't get the GP tool for the ArcSDE file creation to see the server connection. I started a new question here:… – wilbev Sep 1 '11 at 17:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.