microsoft / microsoft/sqlmanagementobjects
Server.IsTraceFlagOn returns true for session scope flags when isGlobalTraceFlag param is true
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 143
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
Repro:
server.SetTraceFlag(1800, isOn: true);
var isOn = server.IsTraceFlagOn(1800, isGlobalTraceFlag: true);
// isOn is "true"
dbcc tracestatus() shows this:
TraceFlag Status Global Session
124 1 1 0
1800 1 0 1
4631 1 1 0
11100 1 1 0
I filed a doc bug at https://github.com/MicrosoftDocs/sql-docs/issues/4920 because it seems tracestatus() and tracestatus(-1) return the same table, even though (-1) is only supposed to return global flags according to the current docs. I think the SMO code was relying on that difference.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with Server.SetTraceFlag, Server.IsTraceFlagOn, and DBCC tracestatus() using flag 1800. Compare the API result for global versus session scope and check the linked SQL documentation issue; done means the scope reported by IsTraceFlagOn matches the intended global-flag behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100