Menu ▼



Posted By :
avatarmrkraju
Total Views : 221

Get file name from file path in SQL

The below query will return the file name from file full path in SQL Server.

Example

DECLARE @filepath VARCHAR(1000)
SET @filepath = 'E:\Data\InputFiles\EmployeeFeed.xlsx'
SELECT  RIGHT(@filepath, CHARINDEX('\', REVERSE(@filepath)) - 1)

Output -> EmployeeFeed.xlsx






comments powered by Disqus


Search dotnetlearners.com