probeer dit: declare @str varchar(20)='MyDoc.doc'; select reverse(left(reverse(@str),charindex('.',reverse(@str))-1)) SQL fiddle-demo