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?
<SPAN class="keyword token">SELECT</SPAN> <SPAN class="punctuation token">(</SPAN>ROW_NUMBER<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">OVER</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">ORDER</SPAN> <SPAN class="keyword token">BY</SPAN> ARN<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> OBJECTID<SPAN class="punctuation token">,</SPAN> ARN<SPAN class="punctuation token">,</SPAN> MOD_DATE<SPAN class="punctuation token">,</SPAN> Shape <SPAN class="keyword token">FROM</SPAN> dbo<SPAN class="punctuation token">.</SPAN>vw_GC_ARN
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
full code I was using:
arcpy<SPAN class="punctuation token">.</SPAN>MakeQueryLayer_management<SPAN class="punctuation token">(</SPAN>
lro16<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"parcels"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"""SELECT (ROW_NUMBER() OVER(ORDER BY ARN)) as OBJECTID, ARN, MOD_DATE, Shape FROM dbo.vw_GC_ARN"""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"OBJECTID"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"POLYGON"</SPAN><SPAN class="punctuation token">,</SPAN> srid<SPAN class="operator token">=</SPAN><SPAN class="string token">"5320"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>