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

SQLCover filters out the SP that has index created on table variable #74

Open
priyasomangali opened this issue Jul 15, 2021 · 0 comments

Comments

@priyasomangali
Copy link

priyasomangali commented Jul 15, 2021

Hi @GoEddie ,

I have SP that has the below declaration with index .

CREATE  PROCEDURE [dbo].[my_procedure_v1]
AS
BEGIN
    SET NOCOUNT ON
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTE
DECLARE @user TABLE (
      [name] [varchar](20) NULL,
      [age] [int ] NULL,
      [ssn] [varchar](20) NOT NULL
      PRIMARY KEY (ssn),
      INDEX  IX01 (name,age,ssn)
)
//DO SOMETHING
END

I am executing tsqlt tests via sqlcover ,
Get-CoverTSql ".\SQLCover.dll" "server=localhost,XXX;User ID=****;Password=******" "db_name" "exec tsqlt.RunAll" -o TestCover

 function Get-CoverTSql{
    param(
        [string]$coverDllPath
    ,[string]$connectionString
    ,[string]$databaseName
    ,[string]$query
    )
    if(!(Test-Path $coverDllPath)){
        Write-Error "SQLCover.dll path was not found ($coverDllPath)"
        return
    }

    Add-Type -Path $coverDllPath

    $coverage = new-object SQLCover.CodeCoverage ($connectionString, $databaseName)
    $coverage.Cover($query)
}

However when I check the xml report generated , the SP (my_procedure_v1 in this case), doesn’t appear . But when I remove the INDEX that I have on the TABLE variable, it comes up in the xml report. Could you please help guide what is the issue here ? Why is SQLCover filtering out the SP. This is a blocker for us as we have bunch of SP that has a similar pattern.

Thanks,
Priya

@priyasomangali priyasomangali changed the title SQLCover filters out the SP that has index created on a user defined tabe SQLCover filters out the SP that has index created on table variable Jul 15, 2021
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

1 participant