Hmm, so I am trying to do this same thing using arcpy in an FME job but will not be loading up a map afterwards. Generating the connection (preferably only in memory) will be followed by tools like "Compress_management" and "DeleteRows_management" (working with a network dataset and FME is a bit limited there).Right now we have to do something like:arcpy.CreateArcSDEConnectionFile_management("c:\Temp", "Temp.sde", ...)
arcpy.env.workspace = "c:\Temp\Temp.sde"
arcpy.DeleteRows_management("FeatureClassName")
os.remove("c:\Temp\Temp.sde")
From the examples linked above, it seems this only works with a map but not necessarily other tools, is that correct? If I remove the line to set "arcpy.env.workspace" then it doesn�??t work anymore... maybe I am missing something?The primary reason for wanting this only in memory is because the connection that is being created is a database account with fairly high privileges, and if something were to happen where the os.remove didn�??t work that .sde file would be out there. We can protect this location behind AD I suppose, but would be nice to just not create it in the first place (auditors would like that). So that�??s my business reason for wanting a pure in memory only option, but that option doesn�??t exist today.