What steps will reproduce the problem?
1.Drop database by pyodbc
What is the expected output? What do you see instead?
Expect that SQL database to be dropped but it's not.
(Error:42000', '[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot
drop database "db_mydatabase" because it is currently in use. (3702)
(SQLExecDirectW)')
I tried SQL management studio GUI to drop the database and it works.
What version of the product are you using? On what operating system?
pyodbc-3.0.7.win32-py2.7.exe / Windows Server 2008 R2
Please provide any additional information below.
ConnectionStr='DRIVER={SQL
Server};SERVER='+SQLserverIP+';DATABASE='+DATABASE_name+';UID='+UID+';PWD='+PWD
sqlconn=pyodbc.connect(ConnectionStr,autocommit=True)
cur=sqlconn.cursor()
cur.execute("DROP DATABASE "+ DATABASE_name)
sqlconn.close()
Original issue reported on code.google.com by s961...@gmail.com on 12 Jun 2014 at 10:42
Original issue reported on code.google.com by
s961...@gmail.com
on 12 Jun 2014 at 10:42