SQLUSA

Microsoft SQL Server 2000 Best Practices

How to parse out filename from path?

 

The following query will separate the filename from the pathname:

 

select reverse(left(reverse('\\Prodserver\D$\export\Data20060401.txt'),
charindex('\',reverse('\\Prodserver\D$\export\Data20060401.txt'),1)-1))

 

American Standard in SQL Server Training
 
SQLUSA.com Home Page