I would like to copy tables to "in_memory". Is this possible?
Background: I noticed processing data and joins is significantly faster when I use the in_memory location. It appears that the copy, copy rows, and feature class to feature class do not allow users to copy tables to the in memory location.
Solved! Go to Solution.
Nevermind, ArcGIS just needed a restart! Using "Copy Rows" works just fine when the output table is set to "in_memory\<output table>" (without quotes).
Thanks for all of your help!
You can copy tables using Copy Rows and feature classes using Copy Features, but curiously, it seems as though Copy Rows does not respect raw path notation.
>>> arcpy.CopyRows_management("myfeatureclass",r'in_memory\table') Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 14392, in CopyRows raise e ExecuteError: ERROR 000210: Cannot create output in_memory\table Failed to execute (CopyRows). >>> arcpy.CopyRows_management("myfeatureclass",r'in_memory\mytable') <Result 'in_memory\\mytable'>
edit: on further inspection, it's not a problem reading raw notation, it is a problem creating a table named "table".
The code most likely threw the error on your first call to Copy Rows because "TABLE" is a SQL Reserved word. You can look at the following page for more information on this topic.
Nevermind, ArcGIS just needed a restart! Using "Copy Rows" works just fine when the output table is set to "in_memory\<output table>" (without quotes).
Thanks for all of your help!
In addition to the documentation that Freddie Gibson references, which I strongly encourage everyone to read, I also strongly encourage people to read the Foreground and background processing documentation. When using in_memory within ArcMap/ArcCatalog (ugh, I wish I could go back to just saying ArcGIS Desktop or Desktop), in_memory doesn't always mean in-memory when background processing is enabled.