Skip to main content

I'm running something like this:

create table #tmp (line varchar(max)) 

insert into #tmp
exec sp_helptext 'sp_Blitz'

declare @version varchar(50); 

select @version=Left@version = Left(line, CHARINDEX('''',line,CHARINDEX('''',line,1)+1))  
from #tmp  
where line like '%@Version =%' 

set @version = reverse(left(REVERSE(@version),CHARINDEX('''',reverse(@version),2))) 

select replace(@version,'''','')

drop table #tmp

I'm running something like :

create table #tmp (line varchar(max))
insert into #tmp
exec sp_helptext 'sp_Blitz'

declare @version varchar(50);
select @version=Left(line, CHARINDEX('''',line,CHARINDEX('''',line,1)+1)) from #tmp where line like '%@Version =%'
set @version = reverse(left(REVERSE(@version),CHARINDEX('''',reverse(@version),2)))
select replace(@version,'''','')

drop table #tmp

I'm running something like this:

create table #tmp (line varchar(max)) 

insert into #tmp
exec sp_helptext 'sp_Blitz'

declare @version varchar(50); 

select @version = Left(line, CHARINDEX('''',line,CHARINDEX('''',line,1)+1)) 
from #tmp 
where line like '%@Version =%' 

set @version = reverse(left(REVERSE(@version),CHARINDEX('''',reverse(@version),2))) 

select replace(@version,'''','')

drop table #tmp
Source Link

I'm running something like :

create table #tmp (line varchar(max))
insert into #tmp
exec sp_helptext 'sp_Blitz'

declare @version varchar(50);
select @version=Left(line, CHARINDEX('''',line,CHARINDEX('''',line,1)+1)) from #tmp where line like '%@Version =%'
set @version = reverse(left(REVERSE(@version),CHARINDEX('''',reverse(@version),2)))
select replace(@version,'''','')

drop table #tmp