My team\'s using a python-based wiki server that calls stored procedures on a SQL Server database. Ideally, we\'d like to return integer values (1,0,-1) from the stored proc
I added the following to get it to work in my application:
def CallStoredProc(conn, procName, *args): sql = """SET NOCOUNT ON; DECLARE @ret int EXEC @ret = %s %s SELECT @ret""" % (procName, ','.join(['?'] * len(args))) return int(conn.execute(sql, args).fetchone()[0])