Closed

Description
Hello,
it appears that .Invoke does not properly utilise output parameters. Within Providers.MsSqlServer.fs, when executeSprocCommand is called, 'returnCols' appears to be null, so output parameters do not get populated.
firstly, here is the stored proc:
ALTER PROCEDURE [dbo].[XXYY]
@hash NVARCHAR(MAX),
@exists bit OUTPUT
AS BEGIN
IF EXISTS (SELECT Hash FROM [Storage].ABC
WHERE Hash = @hash)
BEGIN
SELECT @exists = 1
END
ELSE
SELECT @exists = 0
END
let mutable out = false
db.Procedures.XXYY.Invoke ("test",out)
Result:
exec x.dbo.XXYY @hash=N'test'
go
> System.Data.SqlClient.SqlException (0x80131904): Procedure or function 'XXYY' expects parameter '@exists', which was not supplied.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at FSharp.Data.Sql.Providers.MSSqlServer.executeSprocCommand(IDbCommand com, SprocDefinition definition, QueryParameter[] returnCols, Object[] values) in C:\Users\x\Documents\Visual Studio 2015\Projects\y\src\External\SQLProvider\src\SQLProvider\Providers.MsSqlServer.fs:line 235
at FSharp.Data.Sql.Providers.MSSqlServerProvider.FSharp-Data-Sql-Common-ISqlProvider-ExecuteSprocCommand(IDbCommand con, SprocDefinition definition, QueryParameter[] returnCols, Object[] values) in C:\Users\x\Documents\Visual Studio 2015\Projects\y\src\External\SQLProvider\src\SQLProvider\Providers.MsSqlServer.fs:line 262
at FSharp.Data.Sql.Runtime.SqlDataContext.FSharp-Data-Sql-Common-ISqlDataContext-CallSproc(SprocDefinition definition, QueryParameter[] retCols, Object[] values) in C:\Users\x\Documents\Visual Studio 2015\Projects\y\src\External\SQLProvider\src\SQLProvider\SqlRuntime.DataContext.fs:line 94