Using Azure SQLServer I'm trying to convert only one column to json format. The data is in a nvarchar field. Using For Json Auto
will convert all fields and all rows. What I need is just to convert only one column.
By converting to json what I mean is to be clickable to see it's data a new window inside SSMS.
Let's say the table (Logs) has 2 columns: LogId
and LogData
. LogData
is nvarchar(max)
and contains json data.
What I need is to query the table and have a clickable logData
column.
FOR JSON
will just show the results of the columns and rows you are selecting. You probably have a*
on the column list. Add a new column of JSON type and do an UPDATE to set it's value, then drop the old column.nvarchar
can contain whatever string you want, formatted as Json or not. Please edit your question to include the relevant table DDL + some DML for sample data as well as desired results.clickable
? where do you run the query?