I am trying to take data from a table in SQL Server and create a feature class in an enterprise geodatabase. I'm having issues *I think* with trying to reference a SQL Server table in tools that are expecting a filepath to a table.
I have tried using "MakeXYEventLayer", "MakeQueryLayer", "XYTabletoPoint" and I keep getting errors.
After some reading I think part of the issue is that these tools are looking for a table but I may still need to put a query on the SQL table to get the right results. I'm pretty new to SQL Server tables so I'm not sure.
I think the steps should be:
Is this correct? Can I see an example of how the parameters would be formatted? Example of how I've tried it below:
For input table/input parameters I've tried: xxx.xxx.x.xxx\yyyy\zzzz and xxx.xxx.x.xxx.yyyy.zzzz; setting the IP address/database as the environment workspace then just zzzz; and setting just the IP address as the environment workspace then just yyyy.zzzz and yyyy\zzzz
Hi,
You need to reference a database connection file rather than the IP address: https://enterprise.arcgis.com/en/server/latest/manage-data/windows/connect-sqlserver.htm
Regards,
Marc
Thank you! I didn't get a notification about this and only just saw this now. I had figured out a workaround but this is useful for the future.
I ended up following the steps listed here (https://datatofish.com/export-sql-table-to-csv-python/) and used pyodbc and pandas functions to export the SQL server table into a csv which I could then use with arcpy functions.