sql - substring varchar get first globalid -


i have varchar string , need return first globalid value - 8679926300927194610 string:

 declare @erservice varchar(max) = 'globalid=8679926300927194610,ou=services,globalid=00000000000000000000' 

you can following. assuming string starts globalid=, , there comma after number.

select substring(@erservice,10,charindex(',',@erservice)-10) 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -