Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
--ISJSON() - To verify that the text has valid JSON data
DECLARE @json nvarchar(max)
SET @json =N'
{
"Person": [
{
"FirstName": "Gustavo",
"LastName": "Achong",
"AccountNumber": "AW00029484",
"ModifiedDate" "2014-09-12T11:15:07.263"
}
]
}'
IF (ISJSON(@json) = 1)
PRINT 'It is a Valid JSON'
ELSE
PRINT 'It is an Invalid JSON string' -- Invalid JSON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment