Return type of stored procedures that use temporary tables

Open
#364 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
fsharp, sql
Domain
databases

Research direction

The issue names no implementation files or tests. Start by reproducing the MSSQL procedure and inspecting Sql.GetDataContext().Procedures.Test.Invoke; done means the returned result sets are accessible, ideally with types or at least dynamically.

Written by the indexing model from the issue text.

Description

enhancement sql server
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
Dominant language
F#
Stars
627
Forks
147
Avg merge
2h 2m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fsprojects/SQLProvider

All issues in fsprojects/SQLProvider

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.