_mssql examples — pymssql 2.0.1.2 documentation
www.pymssql.org › _mssql_examplesimport _mssql try: conn = _mssql.connect(server='SQL01', user='user', password='password', database='mydatabase') conn.execute_non_query('CREATE TABLE t1 (id INT, name VARCHAR (50))') except _mssql.MssqlDatabaseException as e: if e.number == 2714 and e.severity == 16: # table already existed, so quieten the error else: raise # re-raise real error finally: conn.close()
pymssql - simple MS SQL Python extension module
pymssql.sourceforge.net › examples__mssqlimport _mssql try: conn = _mssql. connect (server= 'SQL01', user= 'user', password= 'password', \ database= 'mydatabase') conn. execute_non_query ('CREATE TABLE t1(id INT, name VARCHAR(50))') except _mssql. MssqlDatabaseException,e: if e. number == 2714 and e. severity == 16: # table already existed, so quieten the error else: raise # re-raise real error
_mssql examples — pymssql 2.1.2 documentation
pythonhosted.org › pymssql › _mssql_examplesimport _mssql conn = _mssql. connect (server = 'SQL01', user = 'user', password = 'password', database = 'mydatabase') try: conn. execute_non_query ('CREATE TABLE t1(id INT, name VARCHAR(50))') except _mssql. MssqlDatabaseException as e: if e. number == 2714 and e. severity == 16: # table already existed, so quieten the error else: raise # re-raise real error finally: conn. close ()
_mssql examples — pymssql 2.0.1.2 documentation
www.pymssql.org/_mssql_examples.htmlAn example of exception handling ¶. import _mssql try: conn = _mssql.connect(server='SQL01', user='user', password='password', database='mydatabase') conn.execute_non_query('CREATE TABLE t1 (id INT, name VARCHAR (50))') except _mssql.MssqlDatabaseException as e: if e.number == 2714 and e.severity == 16: # table already existed, so quieten the ...