• if you always know the len of the extnetion this should work as well without being so taxing.

    declare @string varchar (100)

    set @string = 'x:\folder1\folder2\folder3\test.txt'

    select SUBSTRING(@string,1, LEN(@string)-8)