Skip to content

Return type of stored procedures that use temporary tables #364

Open
@kerams

Description

@kerams

Description

Stored procedures such as the one below have a return type Unit when invoked.

Repro steps

  1. Create the stored procedure
CREATE PROCEDURE [Test]
AS
BEGIN
  CREATE TABLE #_T (ID int NOT NULL, PRIMARY KEY (ID))
  INSERT INTO #_T(ID)
  VALUES (1)

  SELECT 1
  SELECT 2
  SELECT 3
END
  1. Access the stored procedure using the type provider and inspect the result type
let value = Sql.GetDataContext().Procedures.Test.Invoke ()
// val value : Unit

Expected behavior

Ideally, I'd like to see each result set fully typed. In the worst case, I'd at least want to access the result sets in a dynamic fashion.

Actual behavior

The return type of the sproc is Unit and there is no way to access the returned data.

Known workarounds

None that I know of other than getting rid of temporary tables :)

Related information

  • Used database
    MSSQL
  • SQLProvider version
    1.0.37

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions