Пример
Declare @YourTable Table ([YourTextCol] ntext)
Insert Into @YourTable Values
('21-AUG-2019 09-57-46')
,('2011-Aug-28 18:01:00')
Select *
,NewValue = IsNull(try_convert(datetime,convert(varchar(max),[YourTextCol]))
,try_convert(datetime,left(convert(varchar(max),[YourTextCol]),12)+replace(substring(convert(varchar(max),[YourTextCol]),12,8),'-',':'))
)
From @YourTable
Возвраты
YourTextCol NewValue
21-AUG-2019 09-57-46 2019-08-21 09:57:46.000
2011-Aug-28 18:01:00 2011-08-28 18:01:00.000
Опция с CROSS APPLY и меньшим количеством преобразований
Select A.*
,NewValue = IsNull(try_convert(datetime,v)
,try_convert(datetime,left(v,12)+replace(substring(v,12,8),'-',':'))
)
From @YourTable A
Cross Apply ( values (convert(varchar(max),[YourTextCol])) ) B(v)