python - PyODBC execute stored procedure does not complete -
i have following code, , stored procedure used call several stored procedures. can run stored procedure , complete without issues in sql 2012. using python 3.3.
cnxn = pyodbc.connect('driver={sql server};server=.\sqlexpress;database=mydatabase;trusted_connection=yes;') cursor = cnxn.cursor() cnxn.timeout = 0 cnxn.autocommit = true cursor.execute("""exec my_sp""")
the python code executing, have determined inserting numerous prints. did see other question regarding python waiting sp finish. tried adding 'time.sleep()' after execute, , varying time (up 120 seconds) no change. stored procedure appears partially executing, based on results. data suggests interrupting 1 of sub-stored procedures, yet fine when sp run query analyzer.
my best guess sql config related, lost in look.
any thoughts?
just follow up; have had limited success using time features located @ link below, , reducing level of nesting stored procedures.
at level calling in above, there 4 layers of nested sp's; pyodbc seems behave little better when have 3 layers or less. doesn't make lot of sense me, works.
make python wait stored procedure finish executing
any input on rationale behind appreciated.
Comments
Post a Comment