Title: JSON_OBJECT does not parse inside RETURN statement · Issue #181 · microsoft/SqlScriptDOM · GitHub
Open Graph Title: JSON_OBJECT does not parse inside RETURN statement · Issue #181 · microsoft/SqlScriptDOM
X Title: JSON_OBJECT does not parse inside RETURN statement · Issue #181 · microsoft/SqlScriptDOM
Description: Version - 170.128.0 Parser - TSql170Parser JSON_OBJECT when inside RETURN statement does not get parsed with above mentioned parser version and details. Steps to reproduce - Try parsing the below SQL script with the parser: ALTER FUNCTIO...
Open Graph Description: Version - 170.128.0 Parser - TSql170Parser JSON_OBJECT when inside RETURN statement does not get parsed with above mentioned parser version and details. Steps to reproduce - Try parsing the below S...
X Description: Version - 170.128.0 Parser - TSql170Parser JSON_OBJECT when inside RETURN statement does not get parsed with above mentioned parser version and details. Steps to reproduce - Try parsing the below S...
Opengraph URL: https://github.com/microsoft/SqlScriptDOM/issues/181
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JSON_OBJECT does not parse inside RETURN statement","articleBody":"#### Version - `170.128.0`\n#### Parser - TSql170Parser\n \n`JSON_OBJECT` when inside `RETURN` statement does not get parsed with above mentioned parser version and details.\n \n### Steps to reproduce -\nTry parsing the below SQL script with the parser:\n```\nALTER FUNCTION FnName\n ()\nRETURNS NVARCHAR(MAX)\nAS\n BEGIN\n RETURN\n JSON_OBJECT('Authorization' : 'Bearer ' + (SELECT Value1\n FROM dbo.table1\n WHERE field1 = 'Token'));\n END;\nGO\n```\n\nExample - \n```\n static void Main(string[] args)\n {\n var script = \"\u003cExample Script\u003e\";\n \n var parser = new TSql170Parser(true, 0);\n var fragment = parser.Parse(new StringReader(script), out var parseErrors);\n \n if (parseErrors.Count \u003e 0)\n {\n Console.WriteLine(parseErrors[0].Message);\n }\n }\n```\n \n### Error message :-\n```Incorrect syntax near 'JSON_OBJECT'.```\n\nThis issue is created as a part of follow-up for #137 since it was closed without a fix.","author":{"url":"https://github.com/naveennaik1","@type":"Person","name":"naveennaik1"},"datePublished":"2025-11-07T06:16:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/181/SqlScriptDOM/issues/181"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1786c46d-67a5-1033-b2fc-b12b925ee839 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA84:1EC4E1:2AB4988:367C082:6991B579 |
| html-safe-nonce | 5e8218f999b46beca12902928e4c92f869741bff7514768597dc0e6c9bcd7514 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTg0OjFFQzRFMToyQUI0OTg4OjM2N0MwODI6Njk5MUI1NzkiLCJ2aXNpdG9yX2lkIjoiMzE4ODcyNjUwNDIxNDM0NTA4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 738f68f98300c9fbac2c05c3bd3f1a3741ff90a247ca98f23e7ec99bf3e975a7 |
| hovercard-subject-tag | issue:3598897042 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/SqlScriptDOM/181/issue_layout |
| twitter:image | https://opengraph.githubassets.com/82b2cc2cf0ad0e90a498a511b90f7261a0341a48caa645959426e1fedd923c78/microsoft/SqlScriptDOM/issues/181 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/82b2cc2cf0ad0e90a498a511b90f7261a0341a48caa645959426e1fedd923c78/microsoft/SqlScriptDOM/issues/181 |
| og:image:alt | Version - 170.128.0 Parser - TSql170Parser JSON_OBJECT when inside RETURN statement does not get parsed with above mentioned parser version and details. Steps to reproduce - Try parsing the below S... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | naveennaik1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/SqlScriptDOM git https://github.com/microsoft/SqlScriptDOM.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 543316377 |
| octolytics-dimension-repository_nwo | microsoft/SqlScriptDOM |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 543316377 |
| octolytics-dimension-repository_network_root_nwo | microsoft/SqlScriptDOM |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width