Something like that
declare @x nvarchar(500) = '1.1.1 chapter1' select substring(@x,1,charindex('.',@x,1+charindex('.',@x))-1) as Major, substring(@x,charindex('.',@x,1+charindex('.',@x)),len(@x)-charindex('.',@x,1+charindex('.',@x))) as Minor
Replace @x in the request.
and fiddle for him: http://sqlfiddle.com/#!3/d41d8/4424/0
updated with. ahead and proof of error
declare @x nvarchar (500) = '1.1.1 chapter1'
select @x, case when charindex('.',@x,1+charindex('.',@x)) <> 0 then substring(@x,1,charindex('.',@x,1+charindex('.',@x))-1) else 'Cannot be parsed' end, case when charindex('.',@x,1+charindex('.',@x)) <> 0 then substring(@x,charindex('.',@x,1+charindex('.',@x)),len(@x)-charindex('.',@x,1+charindex('.',@x))+1) else 'Cannot be parsed' end
and without. ahead
declare @x nvarchar (500) = '1.1.1 chapter1'
select @x, case when charindex('.',@x,1+charindex('.',@x)) <> 0 then substring(@x,1,charindex('.',@x,1+charindex('.',@x))-1) else 'Cannot be parsed' end, case when charindex('.',@x,1+charindex('.',@x)) <> 0 then substring(@x,1+charindex('.',@x,1+charindex('.',@x)),len(@x)-charindex('.',@x,1+charindex('.',@x))) else 'Cannot be parsed' end
http://sqlfiddle.com/#!3/d41d8/4430/0