Guest User

Untitled

a guest
Nov 22nd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. 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"}'
  2.  
  3. DECLARE @pos1 int=CHARINDEX('"Type": ',@json)+LEN('"Type": ')
  4. DECLARE @pos2 int=CHARINDEX(',',@json,@pos1)
  5.  
  6. SELECT CAST(SUBSTRING(@json,@pos1,@pos2-@pos1) AS int)
Add Comment
Please, Sign In to add comment