I was testing my script on a .gdb on my local drive and I got it to work. The actual geodatabase I would like to run the script on is an SDE. I tried changing my filepath from the .gdb to the .sde and it failed. Can someone help me figure out how to configure my script so that it will work on the SDE?
#import system module import arcpy, os #define filepath filepath = r"C:\Users\kkaszas\AppData\Roaming\ESRI\Desktop10.0\ArcCatalog\SANGeodatabase.sde" arcpy.env.workspace = filepath #enable overwrite arcpy.env.overwriteOutput = True fcList = arcpy.ListFeatureClasses() fieldName1 = "Author" fieldName2 = "LastUpdated" expression1 = "\"John Doe\"" expression2 = 20121011 for fc in fcList: arcpy.AddField_management(fc,fieldName1, "TEXT") arcpy.AddField_management(fc,fieldName2, "LONG") print "fields added to " + fc arcpy.CalculateField_management(fc, fieldName1, expression1, "PYTHON") arcpy.CalculateField_management(fc, fieldName2, expression2,"PYTHON") print "Fields have been calculated for " + fc