Skip to content

Instantly share code, notes, and snippets.

@masakiplus
Created December 19, 2012 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masakiplus/4336838 to your computer and use it in GitHub Desktop.
Save masakiplus/4336838 to your computer and use it in GitHub Desktop.
python script to exec procedure
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pymssql
#DB接続
conn = pymssql.connect(host='server', user='user', password='pass', database='dbname')
cur = conn.cursor()
#ストアド・プロシージャ実行
v_sql = 'exec [dbo].[importer]'
cur.execute(v_sql)
conn.commit()
cur.close()
print "CSV import done!!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment