Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pymssql
- # connect to SQL Server instance
- conn = pymssql.connect(host='localhost', user='sa', password='sa', database='nosde')
- # commits every transaction automatically and setup cursor
- conn.autocommit(True)
- cur = conn.cursor()
- # !!Chunk of code stripped out on how I get my coords, unrelated to Q.
- # Store projected coords in a GEOMETRY type field
- geom_type = "geometry::STPointFromText('POINT(%s %s)', 3857)" % (x, y)
- try:
- cur.execute("INSERT INTO tweets (geom) VALUES (%s)" % (geom_type))
- except TypeError:
- print "Could not INSERT", clean
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement