Last active
September 23, 2017 17:04
-
-
Save samirbehara-zz/c27c401b59170a09ee01711d2c61040e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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' --Valid JSON | |
ELSE | |
PRINT 'It is an Invalid JSON string' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment