Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bust out scripted TVFs #1

Open
nycdotnet opened this issue Aug 22, 2014 · 0 comments
Open

Bust out scripted TVFs #1

nycdotnet opened this issue Aug 22, 2014 · 0 comments

Comments

@nycdotnet
Copy link
Owner

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant