I'm trying to extract the file name given a variable file path. Some path examples:
C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\CentralDB.mdf
C:\MSSQL\DATA\CentralDB.mdf
C:\DATA\CentralDB.mdf
Expected Out put should be only the file names, i.e:
CentralDb.mdf
CentralDB.ldf
The file path length can vary form location to location.