If possible, please add options for OUTPUT & INTO when part of an Insert, Update, or Delete. This is in SQL Server.
Also, it would be great to see in a SELECT if 'FOR' got the Before & After options. There is FOR JSON and FOR XML options.
FOR Clause (Transact-SQL) - SQL Server | Microsoft Learn
DELETE
FROM
dbo.p1tProjectNotes
OUTPUT
DELETED.id as id
, DELETED.Notes as Notes
INTO
#tMyDeleted
FROM
dbo.p1tProjectNotes as pn
WHERE EXISTS
(
SELECT
1
FROM
#tMyInts AS t
WHERE
t.id = pn.id
)
;
SELECT
@JsonOut =
(
SELECT
t.id,
t.Notes
FROM
#tMyDeleted AS t
FOR JSON PATH
)
;
IF @JsonOut IS NULL
BEGIN
SET @JsonOut = N'[]'
;
END
I'm planning to handle this as follows:
- OUTPUT column list (DELETED.*, INSERTED.*) will use the existing List formatting settings — so your current comma placement, linebreak, and indentation preferences apply automatically.
- INTO (after OUTPUT) will use the same linebreak settings as FROM — since both introduce a table reference, this gives consistent behavior.
Thanks again for the detailed examples, that's really helpful.
@admin I do use the SSMS plugin. However, I do most of my coding in VS Code. I don't use NPP at all for coding.
I set all the settings in the Desktop App and then have VS Code & SSMS use those settings.
OK, so I will first publish it in the SSMS Plugin. Is it SSMS21/22?
Hi @tangomike, the new ssms21/22 Release including parsing rules for
is not available for download.
Will soon also publish the vscode plugin and deskop app