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

Support SQL Server inline table valued functions? #64

Open
jpdougherty opened this issue Nov 12, 2020 · 1 comment
Open

Support SQL Server inline table valued functions? #64

jpdougherty opened this issue Nov 12, 2020 · 1 comment

Comments

@jpdougherty
Copy link

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

@priyasomangali
Copy link

hi @jpdougherty , did you find any way to handle the above ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants