diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java index 5ad8689c8..c30eab2fa 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java @@ -1450,6 +1450,8 @@ public NClob getNClob(String parameterName) throws SQLException { int l = 0; if (paramNames != null) l = paramNames.size(); + if (l == 0)//Server didn't return anything, user might not have access + return 1;//attempting to look up the first column will return no access exception // handle `@name` as well as `name`, since `@name` is what's returned // by DatabaseMetaData#getProcedureColumns