Cron job to connect to sql server and run a sproc using python -


I want to learn a dragon, and my job is to run a SQL Server 2008 stored procedure through a cron job.

Can I move through a script in Python?

I'm assuming you mean Microsoft's SQL server ... < / P>

  #! / Usr / bin / python import pymssql con = pymssql.connect (host = 'xxxxx', user = 'xxxx', password = 'xxxxx', database = 'xxxxx') cur = con.cursor () query = "DECLARE @ ID INT; EXPUTE sp_GetUserID; SELECT @id; "Cur.execute (query) outputparameter = cur.fetchall () con.commit () taken from con.close ()  

(Copyright Retained)

Put a script in it and run it from the cron ...


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -