microsoft / microsoft/vscode-mssql

[Bug]: Merge Output $Action reported as Invalid Column

Open
#22,356 0 comments 0 reactions 0 assignees View on GitHub
Area - Language Service Bug User-filed
Dominant language
TypeScript
Stars
1.9k
Forks
610
Avg merge
2d 3h
Merged PRs (30d)
97

Description

### Description

I have several Stored Procedures that contain Merge statements. I have recently installed VS Code with the MSSQL extension. When I open any of these Stored Procedures, the Output $Action is identified as an invalid column.

This is similar to Issue: #20411

The Merge statement is in a Stored Procedure, wrapped inside a Try/Catch block

### Steps to Reproduce

1. Connect to db
2. Open stored procedure containing a Merge statement with Output $Action clause
3. Parser identifies $Action as an invalid column

Image

### Affected Area

- [ ] Connection dialog (SQL Server | Azure browse/Fabric browse)
- [x] Query editor
- [ ] Query results panel
- [ ] Object Explorer
- [ ] GitHub Copilot integration
- [ ] Preview/Edit data
- [ ] Table Designer
- [ ] Schema Designer
- [ ] Schema Compare
- [ ] Local SQL Server Container provisioning
- [ ] SQL database in Fabric provisioning
- [ ] DACPAC/BACPAC export/import
- [ ] SQL Database projects
- [ ] Query Plan Visualizer
- [ ] Other (please describe below)

### If you selected "Other", please describe the affected area

_No response_

### Environment Information

VS Code: 1.125.1
MSSQL: 1.43.0
Windows: 11

### Confirmation

- [x] I have searched existing issues and couldn't find a match
- [ ] I want to work on this issue

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the report in the query editor with a stored procedure containing a MERGE statement, an OUTPUT $Action clause, and a TRY/CATCH block. Confirm that the parser reports $Action as an invalid column, then trace the query-editor parser behavior until the diagnostic is no longer reported for this statement.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, typescript
Domain
database, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.