I am trying to use Arcpy to run the CopyFeatures_management script so that I can copy a featurelayer in SDE.
What do I use for the input (and output, for that matter, since I'll be copying the layer back to SDE) to access the layer?
You'll use the path to the SDE file plus the feature class name, so something like
Two ways that I can think of, both involve having a Database Connection already set up in ArcCatalog. If the Database Connection file does not already exist, you can use CreateArcSDEConnectionFile_management in your script to create it.
1) Set the current workspace to the database connection, and then refer to the feature class by name.
If the feature class is in a feature dataset, tack on the the feature dataset name to the workspace like so:
2) Supply the full path to the feature class including the database connection:
Some tools require the first method, others require the second.
Also "Database Connections" is actually just a shortcut to