Click here to Skip to main content
15,898,222 members
Articles / Database Development / SQL Server / SQL Server 2014

Extracting the filename from a full path in SQL Server

Rate me:
Please Sign up or sign in to vote.
4.96/5 (8 votes)
19 Jan 2015CPOL1 min read 80.9K   218   10  
Sometimes, you want to extract the filename (with or without the extension) from the full path of a file. It's easy in C# and so forth - just use the Path.GetFileName method. But what if you want it in SQL?

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO
Wales Wales
Born at an early age, he grew older. At the same time, his hair grew longer, and was tied up behind his head.
Has problems spelling the word "the".
Invented the portable cat-flap.
Currently, has not died yet. Or has he?

Comments and Discussions