Skip to content

Bust out scripted TVFs #1

@nycdotnet

Description

@nycdotnet

First practical feature should be the ability to bust out scripted Table Valued Functions.

For example, given this function

CREATE FUNCTION dbo.MyFunction ( @Something INT)
RETURNS @Results TABLE (
    Col1 CHAR(8) PRIMARY KEY, Col2 INT NOT NULL
)
AS BEGIN
    INSERT INTO @Results VALUES ('ABCDEFGH',100);
    RETURN
END

The parser should be able to bust it out to this:

DECLARE @Something INT
DECLARE @Results TABLE (
    Col1 CHAR(8) PRIMARY KEY, Col2 INT NOT NULL
)

INSERT INTO @Results VALUES ('ABCDEFGH',100);
SELECT * FROM @Results

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions