8

enter image description here In this picture, result column name(JSON_F52...) is auto-generated by SQL Server. How to change this name to unique name?

Ahmad Aghazadeh
  • 16,571
  • 12
  • 101
  • 98

1 Answers1

21

Can use this code:

SELECT (SELECT TOP 100 * FROM [Order] FOR JSON AUTO) AS ColumnName

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ahmad Aghazadeh
  • 16,571
  • 12
  • 101
  • 98