Como gerar JSON tabela SQL em poucas linhas

DECLARE @x NVARCHAR(MAX) = (SELECT top 10 * FROM #nome_da_tabela FOR JSON AUTO) SELECT @x

Loading