If I run the following query in python 2.7 it allows me to use OBJECTID as the unique ID field but in python 3 it does not. Does anyone know why or how to get it to work?
SELECT (ROW_NUMBER() OVER(ORDER BY ARN)) as OBJECTID, ARN, MOD_DATE, Shape FROM dbo.vw_GC_ARN
full code I was using:
arcpy.MakeQueryLayer_management( lro16, "parcels", """SELECT (ROW_NUMBER() OVER(ORDER BY ARN)) as OBJECTID, ARN, MOD_DATE, Shape FROM dbo.vw_GC_ARN""", "OBJECTID", "POLYGON", srid="5320")
This could be how the GP tool is interpreting the column (Long vs Short integer) upon creation and may be a bug. If you run the GP tool manually in Pro, do you experience the same issue?