GoEddie / GoEddie/SQLCover

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

Open
#74 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TSQL
Stars
69
Forks
55
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the supplied Get-CoverTSql command against the procedure with and without the table-variable INDEX, then compare the generated XML reports. Trace where SQLCover discovers or filters stored procedures during coverage and determine why the indexed version is omitted; done means the procedure appears in the report while retaining its index.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.