THanks for your reply
THe SQL connection see very famililar to others so I dont think that is going to be much of a problem.
ON the other hand creating an in memory table and then Geocoding to that and then using that to update the original SQL table....not getting my brain around that one....can you explain more...are there examples for this in moemory table creation..and then how wold I apply that table to the SQL Table?
Thanks
EDIT:
1. Are you saying to create a table like in your second link with the values from the SQL Server table.
2. Geocode against this table creating an output Feature Class
3. Then copy over the XY from the new Feature Class to the Original Table in SQL Server
4. Then Delete the Created table and Feature Class
I was mainly pointing out ways to acquire the SQL server data, but yes you could populate a temporary table or an in_memory table with those rows and Geocode from this. You'll have to deal with the field mapping (depending upon the database, it may not map directly to the temp table you need to create) --- here's how I deal with a cursor from an Oracle table (sorry for formatting issues. it doesn't paste well into the editor here and python needs good formatting!):
gp.createtable_management("IN_MEMORY", "TempDT", "", "")
cxRows = cursor.fetchall()
rowcount = cursor.rowcount
for row in range(1, rowcount - 1):
tables = gp.ListTables()
for tbl in tables:
if tbl=="TempDT":
### add the fields
for i in range(0, len(cursor.description)):
val1 = str(cursor.description[0])
val2 = str(cursor.description[1])
val3 = str(cursor.description[2])
if val2=="<type 'cx_Oracle.STRING'>":
fldType = "Text"
val3 = cursor.description[2]
gp.AddField(tbl, str(cursor.description[0]), fldType, val3)
if val2=="<type 'cx_Oracle.NATIVE_FLOAT'>":
fldType = "Float"
gp.AddField(tbl, str(cursor.description[0]), fldType)
if val2=="<type 'cx_Oracle.DATETIME'>":
fldType = "Date"
gp.AddField(tbl, str(cursor.description[0]), fldType)
### now populate the table
insRows = gp.InsertCursor(tblNew)
for cxRow in cxRows:
insRow = insRows.newRow()
for i in range(0, len(cursor.description)):
insRow.setvalue(str(cursor.description[0]), cxRow)
insRows.insertRow(insRow)
cursor.close()
db.close()
***The above are snippets pulled from a larger def() so it may not work directly and require you to modify for your needs. It is intended to be a general outline/view as to how I go from Oracle table to in_memory table.Good luck!