I wrote a script to select features from a sql server spatial database based on date, there are thousands and thousands of records. The script runs but when I used the CopyFeatures_management tool, the resulting feature class only has 1000 features in it when it should have more. (the correct amount is achieved when I run the process manually) I'm running ArcGIS 10.4 if that makes a difference.
I'm hoping to find out why the script doesnt fully complete and crashes before finishing and only selects 1000 records.
print "start"
import arcpy
from arcpy import env
env.overwriteOutput=True
DB_connection = "Database Connections\\CNTM_MAC_GIS(EPRD-SHS12-LTR,62246).sde"
Output_Feature_Layer = "gps_points"
arcpy.MakeQueryLayer_management(DB_connection, Output_Feature_Layer, "select * from CMTEN_MAC_GIS.dbo.tben_SCSGPSData", "Record_ID", "POINT", "4326", "") #selecting from sde
selection=arcpy.SelectLayerByAttribute_management(Output_Feature_Layer, "NEW_SELECTION", "RecordUpdate_DTM > '2018-10-01 07:48:09' AND RecordUpdate_DTM < '2018-10-30 07:50:04'") #selecting date ranges, beginning to end of month
saved_to="W:\MAC\GIS\Client_Requests\Stats\gps.gdb\gpspoints" #output filepath
arcpy.CopyFeatures_management(selection, saved_to) #saving to location
print "done"
tben_SCSGPSData
a SDE feature class? Why make a query layer that just selects all the features?