google-code-export / pymssql

Automatically exported from code.google.com/p/pymssql
GNU Lesser General Public License v2.1
0 stars 0 forks source link

callproc raise _mssql.MSSQLDatabaseException #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps for reproduce:
1. create stored proc raised exception:
CREATE PROCEDURE except_test
AS 
BEGIN
  RAISERROR('error message', 18, 1)
  RETURN
END

2. Calling tested proc (file callproc_err.py):
conn = pymssql.connect(...)
curs = conn.cursor()
curs.callproc('except_test')

3. Exec simple code
python callproc_err.py
Traceback (most recent call last):
...
  File "pymssql.pyx", line 360, in pymssql.Cursor.callproc (pymssql.c:3814)
    self._returnvalue = proc.execute()
  File "_mssql.pyx", line 1289, in _mssql.MSSQLStoredProcedure.execute (_mssql.c:11634)
    check_cancel_and_raise(rtc, self.conn)
  File "_mssql.pyx", line 1324, in _mssql.check_cancel_and_raise (_mssql.c:11941)
    return maybe_raise_MSSQLDatabaseException(conn)
  File "_mssql.pyx", line 1366, in _mssql.maybe_raise_MSSQLDatabaseException (_mssql.c:12484)
    raise ex
_mssql.MSSQLDatabaseException: (50000, 'error messageDB-Lib error message 
50000, severity 18:\nGeneral SQL Server error: Check messages from the SQL 
Server\n')

May by translate MSSQLDatabaseException to ProgrammingError or DatabaseError?

Original issue reported on code.google.com by tonal.pr...@gmail.com on 3 Jun 2011 at 5:32

GoogleCodeExporter commented 9 years ago
My environment:
Os Kubuntu 11.04 with all latest updates
Python 2.7.1+ (2.7.1-0ubuntu5)
cython 0.13-1build1
gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
pymssql source from hg (hg summary: parent: 214:66579aff6824 tip)

Original comment by tonal.pr...@gmail.com on 3 Jun 2011 at 8:22

GoogleCodeExporter commented 9 years ago

Original comment by rsyr...@gmail.com on 8 Mar 2012 at 3:22