Skip to content

Support SQL Server inline table valued functions? #64

@jpdougherty

Description

@jpdougherty

Is your feature request related to a problem? Please describe.
We've been changing several of our table valued functions from the standard format like below to inline table valued functions

CREATE FUNCTION dbo.FN_SomeFunction(
@inputvar VARCHAR(50)
)
RETURNS @functionResult TABLE (
output VARCHAR(50)

)
AS
BEGIN
INSERT INTO @functionResult(output)
Select resultOutput as output
from dbo.TableA
where something = @inputvar;

 RETURN

END;

We've found numerous performance improvements by using inline TVF functions where it's written like:
CREATE FUNCTION dbo.FN_SomeFunction(
@inputvar VARCHAR(50)
)
RETURNS TABLE
AS
RETURN (
Select resultOutput as output
from dbo.TableA
where something = @inputvar;
);

Describe the solution you'd like
@GoEddie
Is there a way to get SQLCover to cover these functions when a tSQLt test is created for this function? It does not show up in the list of evaluated code objects or in the coverage.coverxml outputs.

Describe alternatives you've considered
The only alternative I have is to put the functions back but then we degrade our performance.

===
Please at me @GoEddie so I receive a notification

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions