microsoft / microsoft/sql-server-samples

SQL Assessment falsely flagging deprecated features in job steps

Open
#1,025 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
11.2k
Forks
9.1k
Avg merge
2d 7h
Merged PRs (30d)
14

Description

Microsoft ruleset 1.0.305 has some checks against the commands column of msdb.dbo.sysjobsteps to see if deprecated code is used within the jobs. However, the code looks for at job steps that are both T-SQL and PowerShell.

...
AND sjs.[subsystem] IN ('TSQL','PowerShell');

https://github.com/microsoft/sql-server-samples/blob/03e4eb1802030fc0d57cb249cb33752c8e91c0fc/samples/manage/sql-assessment-api/ruleset.json#L11570-L11575

We are seeing jobsteps that use the words 'load' or 'text' which are deprecated SQL features get flagged, but they are running PowerShell.

image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with samples/manage/sql-assessment-api/ruleset.json at lines 11570-11575 and inspect the checks against msdb.dbo.sysjobsteps.commands and subsystem. Reproduce the false positive with a PowerShell job step containing “load” or “text”; done means deprecated SQL features are checked without flagging matching text in PowerShell steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, sql
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.