title: Remove backslashes from JSON SQL Query
body: <p>I am constructing JSON object using SQL Server query. I have issues with slashes and also i need data in specific format as mentioned below. The actual output has slashes in it. I want to eliminate slashes from my output query.</p>
  
  <pre><code>    SELECT (SELECT 
           ('{'+'"value":'+ cast(ISNULL(SP.ACCOUNT_TRAFFIC_DEP_LICENSE_NUMBER,'') as varchar) )                       AS TRAFFIC_DEP_LICENSE_NUMBER
          ,(  '{' +'"value":'+cast(ISNULL(SP.NUMBER_OF_VEHICLES   ,'')    as varchar)     )                                   AS NUMBER_OF_VEHICLES
           ,( '{' +'"value":'+cast(ISNULL(SP.ACCOUNT_TRAFFIC_DEP_LICENSE_START_H_DATE,'') as varchar) )                                       AS TRAFFIC_DEP_LICENSE_START_H_DATE
           ,( '{' +'"value":'+cast(ISNULL(SP.ACCOUNT_TRAFFIC_DEP_LICENSE_END_H_DATE   ,'')    as varchar)     )                           AS TRAFFIC_DEP_LICENSE_END_H_DATE
          ,(  '{' +'"value":'+cast(ISNULL(SP.SUSPENSION_BY_MORROR_STATUS,'')  as varchar)         )                                           AS SUSPENSION_BY_MORROR_STATUS
           ,( '{' +'"value":'+cast(ISNULL(SP.SUSPENSION_BY_VIOLATION  ,'')    as varchar)     )                                           AS SUSPENSION_BY_VIOLATION
           ,( '{' +'"value":'+cast(ISNULL(SP.SUSPENSION_BY_PENALTY        ,'')    as varchar)     )                                           AS SUSPENSION_BY_PENALTY
                  from [dbo].[TAMM_CAC_ACCOUNTS_STG]  SP 
                  where SP.Account_Reference_Number = CAC.Account_Reference_Number
                  AND (
                  ACCOUNT_TRAFFIC_DEP_LICENSE_NUMBER IS NOT NULL OR 
                  NUMBER_OF_VEHICLES IS NOT NULL OR
                  SP.ACCOUNT_TRAFFIC_DEP_LICENSE_END_H_DATE   IS NOT NULL OR
                  SP.ACCOUNT_TRAFFIC_DEP_LICENSE_END_H_DATE   IS NOT NULL OR
                  SP.SUSPENSION_BY_MORROR_STATUS              IS NOT NULL OR
                  SP.SUSPENSION_BY_VIOLATION          IS NOT NULL OR      
                  SP.SUSPENSION_BY_PENALTY        IS NOT NULL     )   FOR JSON PATH,INCLUDE_NULL_VALUES
  
  
   ) AS specifics
              from dbo.Customer_Account CAC
  </code></pre>
  
  <p>The above query gives me desired output but It has backslashes.</p>
  
  <pre><code>[
    {
      "TRAFFIC_DEP_LICENSE_NUMBER": "{\"value\":0",
      "NUMBER_OF_VEHICLES": "{\"value\":1009",
      "TRAFFIC_DEP_LICENSE_START_H_DATE": "{\"value\":14351229",
      "TRAFFIC_DEP_LICENSE_END_H_DATE": "{\"value\":14351229",
      "SUSPENSION_BY_MORROR_STATUS": "{\"value\":0",
      "SUSPENSION_BY_VIOLATION": "{\"value\":1",
      "SUSPENSION_BY_PENALTY": "{\"value\":1"
    }
  ]
  </code></pre>
  
  <p>actual expected output is below</p>
  
  <pre><code>“specific”:{
  "TRAFFIC_DEP_LICENSE_NUMBER":{“value”:0},
              "NUMBER_OF_VEHICLES":{“value”:22},
              "TRAFFIC_DEP_LICENSE_START_H_DATE":{“value”: 14480608},
              "TRAFFIC_DEP_LICENSE_END_H_DATE":{“value”: 14480608},
              "SUSPENSION_BY_MORROR_STATUS":{“value”:0},
              "SUSPENSION_BY_VIOLATION":{“value”:1},
              "SUSPENSION_BY_PENALTY":{“value”:1},
  }
  </code></pre>