How can I trap an EXEC error? @@rowcount and @@error aren't ever available... The SP seems to stop running altogether once the return is not a result set...
For example:
If the username/password is incorrect, the return is:
OLE DB provider 'MSDAORA' reported an error. Authentication failed.
[OLE/DB provider returned message: ORA-01017: invalid username/password; logon denied
]
OLE DB error trace [OLE/DB Provider 'MSDAORA' IDBInitialize::Initialize returned 0x80040e4d: Authentication failed.].
I want to trap an error somehow...
For example:
Code:
SET @strOracleSQL = ''
SET @strOracleSQL = @strOracleSQL + 'Select role from session_roles'
SET @strSQL = ''
SET @strSQL = @strSQL + 'SELECT Role '
SET @strSQL = @strSQL + 'FROM OPENROWSET(''MSDAORA'',''192.168.1.100'' ; ''testuser'' ; ''password'', '''+RTRIM(@strOracleSQL)+''') '
EXEC (@strSQL)
If the username/password is incorrect, the return is:
OLE DB provider 'MSDAORA' reported an error. Authentication failed.
[OLE/DB provider returned message: ORA-01017: invalid username/password; logon denied
]
OLE DB error trace [OLE/DB Provider 'MSDAORA' IDBInitialize::Initialize returned 0x80040e4d: Authentication failed.].
I want to trap an error somehow...