I have written the name of a file with extension (FILE.txt) in a database column. I need to show in a SELECT only the FILE instead of ARCHIVE.txt
Does anyone know how to do it?
I have written the name of a file with extension (FILE.txt) in a database column. I need to show in a SELECT only the FILE instead of ARCHIVE.txt
Does anyone know how to do it?
I've done an example that caters to several cases. Example: file.txt, file.secret.txt, file.jpeg.
Declare @campo varchar(100) = 'Arquivo.txt'
select left(@campo,len(@campo) - charindex('.',reverse(@campo)) ) resultado