SELECT REPLACE(UPPER(usersid), ' ', '_') as m FROM applications
SELECT [ROW_ID]
,[ФИО]
,upper(SUBSTRING (([ФИО]),1,CHARINDEX(' ',[ФИО])-1)+'_'+SUBSTRING (([ФИО]),CHARINDEX(' ',[ФИО])+1,1) +''+
SUBSTRING (([ФИО]),(CHARINDEX(' ',[ФИО])+CHARINDEX(' ',SUBSTRING (([ФИО]),CHARINDEX(' ',[ФИО])+1,100)))+1,1))
FROM [Карточки регистрации] k
where k.[ROW_ID] in (908,247,809)