Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @json varchar(1000)='{ "Id": 1785, "Type": 10, "Vendor": "vendor1", "Brand": "brand1", "LOB": 0, "Category": "Supported", "Name": "Security Bulletin", "MarketVersion": "WW17-150", "InternalVersion": "1.0", "Edition": "", "Role": "", "CDIVersion": "", "BuildVersion": "", "Patch": "", "Hotfix": "", "Arch": "x86", "ReleaseDate": "2017-09-29", "Released": 1, "Locale": "en-us", "Tag": "", "ConfigDetails": "", "Description": "Security-Only update for Windows (KB4038779, KB4038786, KB4038793)", "Notes": "Wonderware Security Bulletin WW17-085", "UpdateDate": "2017-09-29", "ExceptionStatement": "dddddd"}'
- DECLARE @pos1 int=CHARINDEX('"Type": ',@json)+LEN('"Type": ')
- DECLARE @pos2 int=CHARINDEX(',',@json,@pos1)
- SELECT CAST(SUBSTRING(@json,@pos1,@pos2-@pos1) AS int)
Add Comment
Please, Sign In to add comment